E Business Services - Market Leading E Business Solutions

 
 

ODBC / OLEDB - Connection Strings

 
   

These examples demonstrate how to connect to Access databases via your ASP ADO code.

 
 


Notes from Microsoft:

Access ODBC Driver and Microsoft OLE DB Provider for Microsoft Jet are not intended to be used with high-stress, high-concurrency, 24x7 server applications, such as web, commerce, transactional, messaging servers.

When running Microsoft Jet in an IIS environment, it is recommended that you use the native Jet OLE DB Provider in place of the Microsoft Access ODBC driver. The native Jet OLE DB Provider includes fixes and enhancements for stability, performance, and thread pooling.

 

Access ODBC Jet - DSN Connection

 

Dim conn

set conn = Server.CreateObject("ADODB.Connection")
conn.Open "dsn=mydatabase;uid=admin;PWD=xxx"

...

conn.close
set conn=nothing

 

Access Jet ODBC - DNS-Less Connection

 

Dim conn, dbPath 
dbpath = server.mappath("\mydatabase.mdb")

set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & dbpath & ";UID=admin;PWD=xxx;"

...

conn.close
set conn=nothing

 

Access OLEDB - DSN-Less Connection (Recommended)

 

Dim Conn, dbPath 
dbpath = server.mappath("\mydatabase.mdb")

set conn = Server.CreateObject("ADODB.Connection")
conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath & ";USER ID=admin;PASSWORD=xxx;"

...

conn.close
set conn=nothing

 

 

Downloads:

odbc-oledb.txt above examples in a text file

References:

Microsoft Q193332 - Knowledgebase Article

 

 



Web Hosting | Domains | E-Mail | WebMail
Home | About | Help | StatusControl Panel | TermsContact

 

 

E Business Services

Copyright © 1998-2017 E Business Services Limited



Call - SALES - 0800 1695867
Powered By: E Business Services - DataPumps