VBScript连接数据库

时间:2022-03-14 03:09:26
 'access类型
dim strconn,objconn
strconn="driver=microsoft access driver(*.mdb);dbq=" _
& Server.MapPath("db.mdb")
set objconn=Server.CreateObject("ADODB.Connection")
objconn.open strconn
'sql类型
strconn="driver={sql server};descript=sqldemo;server=127.0.0.0;" _
& "uid=loginid;password=;database=databasename"
set objconn=server.createobject("adodb.connection")
objconn.open strconn