ADO数据对象用来连接数据库的方式有两种,分别是ODBC和OLE DB方式
(一) 使用OLE DB方式
********************************************************
*** OLE DB Provider for Microsoft Jet
********************************************************
Dim oConn,strConn
Set oConn=teObject("ection")
StrConn= "Provider=B.4.0;" & _
"Data Source=c:;" & _
"User Id=admin;" & _
"Password=;"
strConn
********************************************************
*** OLE DB Provider for ODBC Databases
********************************************************
访问MS Access数据库
Dim oConn,strConn
Set oConn=teObject("ection")
StrConn= "Provider=MSDASQL;" & _
"Driver={Microsoft Access Driver (*)};" & _
"Dbq=c:;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
strConn
(二) 使用ODBC方式
********************************************************
*** ODBC Driver for Access
********************************************************
Dim oConn,strConn
Set oConn=teObject("ection")
StrConn= "Driver={Microsoft Access Driver (*)};" & _
"Dbq="&Server.MapPath(""); & _
"Uid=AdminAccount;" & _
"Pwd=Password;"
strConn