MS Access database connection
Connect with DSN and no username and password:
<% set conn = server.createObject ("adoDb.connection" conn.open "YourDsnname"%>
Connect with DSN and have usernames and passwords:
<% set conn = server.createObject ("AdoDb.Connection") Conn.open "YourDsnname", "UserName", "Password"%>
Use the actual database absolute path connection:
<% Set conn = server.createObject ("adoDb.connection") strconn = "driver = {microsoft access driver (* .mdb)};" strconn = strconn & "dbq = e: /yanhang/database.mdb" conn. Open strConn%>
Connect with the actual database:
<% Set conn = server.createObject ("adoDb.connection") strconn = "driver = {Microsoft Access Driver (* .mdb)};" strconn = strconn & "dbq =" & server.mAppath ("/ database / Yanhang .mdb ") Conn.open strconn%>
MS SQL Server Database Connection
Use DSN:
<% set conn = server.createObject ("adoDb.connection") conn.open "DSN = mydsn; uid = user; pwd = password; database = databasename"%>
No DSN connection:
<% Set conn = server.createObject ("adoDb.connection") DSNTemp = "driver = {SQL Server}; server = servername; uid = user; pwd = password; database = databasename" conn.open dsntemp%>
FoxPro database connection
<% Set Conn = Server.CreateObject ( "ADODB.connection") ConnStr = "Driver = Microsoft Visual Foxpro Driver; UID = userID; SourceType = DBC; SourceDB = C: /yanhang/database.dbc" Conn.Open ConnStr%>
Oracle Database Connection: