HAL-PC Web Technolgies SIG

Mail List | SIG Leader

ASP CONNECTION STRINGS

HAL-PC Web Technologies SIG

DSN-Less Connection for Access

strconn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db.mdb")
set conn = Server.CreateObject("ADODB.Connection")
conn.open strconn

OLE DB Method for Access

And yet another way of connecting to a database is to specify the ODBC driver to use:

set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\server\dbname.mdb"

System DSN

set conn = Server.CreateObject("ADODB.Connection")
conn.open "Example"

ODBC DSN

set rs = Server.CreateObject("ADODB.Recordset")
rs.open "tblname", "DSNName", 3, 3

Note: Follow the instructions of your web host to set up a DSN.

About Us | Site Map | Advanced Search | Privacy Policy | Contact Us | ©1999-2006 HAL-PC Web Technologies SIG Leader Cheryl D. Wise