C # access connection string

Source: Internet
Author: User

1. Add a password to the Access Database: Open the Office Access Program, select the ACCESS database path, click the drop-down arrow of the open button, and select Open exclusively ",

Find the "database tool" menu, click "set Database Password", and enter the password.

2. Cancel the Database Password: Similarly, you must enable it exclusively. Click "undo Database Password" and enter the original password to undo it.

The above is the operation method of access 2007.


Dedicated connection:

"Driver = {Microsoft Access Driver (*. MDB)}; DBQ = c: \ app1 \ your database name. MDB; exclusive = 1; uid = your user name; Pwd = your password ;"

MS access oledb & oledbconnection (oledb interface under. net) for the link

Common (most commonly used) Access database connection:

"Provider = Microsoft. Jet. oledb.4.0; daTa source = c: \ app1 \ your database name. mdb; user id = admin; Password ="

Use a working group (System Database) to connect to the ACCESS database:

"Provider = Microsoft. Jet. oledb.4.0; daTa source = c: \ app1 \ your database name. mdb; Jet oledb: System database = c: \ app1 \ your system database name. MDW"

Connect to the ACCESS database with a password:

"Provider = Microsoft. Jet. oledb.4.0; daTa source = c: \ app1 \ your database name. mdb; Jet oledb: Database Password = your password"

Connect to the ACCESS database on the LAN Host:

"Provider = Microsoft. Jet. oledb.4.0; daTa source = \ SERVER_NAME \ Alibaba _name \ Alibaba _path \ your database name. mdb"

Connect to the ACCESS database on the remote server:

"Provider = MS remote; Remote Server = http: // Remote Server IP; remote provider = Microsoft. Jet. oledb.4.0; daTa source = c: \ app1 \ your database name. mdb"

MS access ODBC open interface connection string

Standard link:

"Driver = {microsoftaccessdriver (*. mdb)}; DBQ = c: \ app1 \ your database name. mdb; uid = your username; Pwd = your password ;"

If no user name or password is set for the Access database, leave it blank. The same below.

Workgroup connection:

"Driver = {Microsoft Access Driver (*. MDB)}; DBQ = c: \ app1 \ your database name. MDB; systemdb = c: \ app1 \ your database name. MDW ;"

Dedicated connection:

"Driver = {Microsoft Access Driver (*. MDB)}; DBQ = c: \ app1 \ your database name. MDB; exclusive = 1; uid = your user name; Pwd = your password ;"

MS access oledb & oledbconnection (oledb interface under. net) for the link

Common (most commonly used) Access database connection:

"Provider = Microsoft. Jet. oledb.4.0; daTa source = c: \ app1 \ your database name. mdb; user id = admin; Password ="

Use a working group (System Database) to connect to the ACCESS database:

"Provider = Microsoft. Jet. oledb.4.0; daTa source = c: \ app1 \ your database name. mdb; Jet oledb: System database = c: \ app1 \ your system database name. MDW"

Connect to the ACCESS database with a password:

"Provider = Microsoft. Jet. oledb.4.0; daTa source = c: \ app1 \ your database name. mdb; Jet oledb: Database Password = your password"

Connect to the ACCESS database on the LAN Host:

"Provider = Microsoft. Jet. oledb.4.0; daTa source = \ SERVER_NAME \ Alibaba _name \ Alibaba _path \ your database name. mdb"

Connect to the ACCESS database on the remote server:

"Provider = MS remote; Remote Server = http: // Remote Server IP; remote provider = Microsoft. Jet. oledb.4.0; daTa source = c: \ app1 \ your database name. mdb"

 

___________________________________

Access Method

There are two ways to open access: one is to open access in bytes, and the other is to share access in bytes, other programs can only upload this file, instead of update and delete. if data confidentiality is set, C # cannot be set. it is opened by sharing.

Set access secret

There are two types of access passwords, which are set in different ways as follows,

(1) "Tools"-> "security"-> "set Database Password"

(2) "Tools"-> "security"-> "users and group accounts"

When you manually open an access file, the system will first prompt you to access the user name and password, and then prompt you to access the data password.

C # using Access

(1) When there is no data confidentiality (there are no methods that can be used to encrypt data), this method is opened in a shared manner.

Oledbconnection dbconn = new oledbconnection (@ "provider = Microsoft. Jet. oledb.4.0; Data Source = D: \ testdb. mdb ;");

(2) When there is data confidentiality (if there is any method that can be used to encrypt data), this method can be opened in proportion.

Oledbconnection dbconn = new oledbconnection (@ "provider = Microsoft. Jet. oledb.4.0; Data Source = D: \ testdb. mdb; Jet oledb: Database Password = 12345 ");

(3) This method can be used when both data encryption and Data Encryption are used. However, even if a password is set for data encryption, it must be empty, this method will also be enabled in proportion.

Oledbconnection dbconn = new oledbconnection (@ "provider = Microsoft. jet. oledb.4.0; Data Source = D: \ testdb. MDB; Jet oledb: Database Password = 12345; persist Security info = true; Password =; user id = admin ");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.