数据库连接范例_MySQL
程序员文章站
2022-06-17 15:45:34
...
OLE DB Method for SQL
set cnn = server.createobject("ADODB.Connection")
cnn.open "PROVIDER=SQLOLEDB;DATA SOURCE=sqlservername;UID=username;PWD=password;DATABASE=databasename "
%>
DSN Less connection for Access
set cnn = server.createobject("ADODB.Connection")
cnn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\anydatabase.mdb"
%>
OLE DB Method for Access
set cnn = server.createobject("ADODB.Connection")
cnn.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=c:\anydatabase.mdb"
%>
File DSN Connection Method for Access
cnn.open "FILEDSN=AccessDSN"
%>
set cnn = server.createobject("ADODB.Connection")
cnn.open "PROVIDER=SQLOLEDB;DATA SOURCE=sqlservername;UID=username;PWD=password;DATABASE=databasename "
%>
DSN Less connection for Access
set cnn = server.createobject("ADODB.Connection")
cnn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\anydatabase.mdb"
%>
OLE DB Method for Access
set cnn = server.createobject("ADODB.Connection")
cnn.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=c:\anydatabase.mdb"
%>
File DSN Connection Method for Access
cnn.open "FILEDSN=AccessDSN"
%>