ACCESS数据库接接代码:
dim db,Conn,ConnStr
db="您的ACCESS数据库路径" set conn=Server.CreateObject("ADODB.Connection") ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(db) conn.open ConnStr
MS SQL Server数据库接接代码:
dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName,Conn,ConnStr
SqlDatabaseName="SQL数据库名称" SqlPassword="SQL数据库登密码" SqlUsername="SQL数据库登陆用户名" SqlLocalName="SQL服务器IP地址"
set conn=Server.CreateObject("ADODB.Connection") ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";" conn.open ConnStr |