答案:access 的
Set Conn=Server.CreateObject("ADODB.Connection")
strConn = "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("./db/ipdb.mdb")
Conn.Open strconn
SQLSERVER 的
dim UserID,pwd,db,host
userID = "sa" '填写MSSQLserver的用户名
pwd = "1234566" '与MSSQLserver的用户对应的密码
db = "zxxxx" '所采用的数据库名
host = "127.0.0.1" 'MSSQLserver的主机名
Set Conn=Server.CreateObject("ADODB.Connection")
strConn = "Provider = SQLOLEDB.1; User ID = "& userID &"; Password ="&pwd&";" &_
"Initial Catalog ="& db &"; Data Source ="&host
Conn.Open strconndim conn,db
dim connstr
db="db/com02.mdb" '数据库文件位置
on error resume next
connstr="DBQ="+server.mappath(""&db&"")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set conn=server.createobject("ADODB.CONNECTION")
上一个:学习ASP都有哪方面的知识
下一个:ASP如何与SQL数据库用在一起?