The detailed description of the figure shows the connection string of ADO access.

Source: Internet
Author: User
Tags ole

Inadvertently msgbox ADO joined the string to join the access connectionstring. So many choices were found. One by one analysis.

 

Standard Practices for connecting to access through ado

There are two ways to connect ADO data objects to a database: ODBC and ole db.

(1) Using OLE DB
**************************************** ****************
* ** Ole db provider for Microsoft Jet
**************************************** ****************
Dim oconn, strconn
Set oconn = server. Createobject ("ADODB. Connection ")
Strconn = "provider = Microsoft. Jet. oledb.4.0 ;"&_
"Data Source = C:/somepath/mydb. mdb ;"&_
"User ID = admin ;"&_
"Password = ;"
Oconn. Open strconn

**************************************** ****************
* ** Ole db provider for ODBC Databases
**************************************** ****************
Access the MS Access Database
Dim oconn, strconn
Set oconn = server. Createobject ("ADODB. Connection ")
Strconn = "provider = msdasql ;"&_
"Driver = {Microsoft Access Driver (*. mdb )};"&_
"DBQ = C:/somepath/mydb. mdb ;"&_
"Uid = myusername ;"&_
"Pwd = mypassword ;"
Oconn. Open strconn

(2) using ODBC
**************************************** ****************
* ** ODBC driver for access
**************************************** ****************
Dim oconn, strconn
Set oconn = server. Createobject ("ADODB. Connection ")
Strconn = "driver = {Microsoft Access Driver (*. mdb )};"&_
"DBQ =" & server. mappath ("testdb. mdb ");&_
"Uid = adminaccount ;"&_
"Pwd = password ;"
Oconn. Open strconn

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.