可能因为你的sqlno没有赋值
如果你的数据库为sqlserver,则将
if SqlNo =1 then
On error resume next
Set Conn=Server.CreateObject("Adodb.Connection")
ConnStr="PROVIDER=SQLOLEDB;DATA SOURCE=3325A06D8;UID=sa;PWD=;DATABASE=ZhiRui"
Conn.open ConnStr
else
Data=""&SitePath&"DataBase/"&DataName&""
on error resume next
Set conn = Server.CreateObject("ADODB.Connection")
connstr="dbq="+server.mappath(Data)+";defaultdir=;driver={microsoft access driver
(*.mdb)};uid=;password="&Psd()&";"
conn.Open connstr
end if
直接替换为
On error resume next
Set Conn=Server.CreateObject("Adodb.Connection")
ConnStr="PROVIDER=SQLOLEDB;DATA SOURCE=3325A06D8;UID=sa;PWD=;DATABASE=ZhiRui"
Conn.open ConnStr
同时检查你的数据库名称,用户名和密码是否正确,如果不正确,设置成对应的
若你的数据库为access则将
if SqlNo =1 then
On error resume next
Set Conn=Server.CreateObject("Adodb.Connection")
ConnStr="PROVIDER=SQLOLEDB;DATA SOURCE=3325A06D8;UID=sa;PWD=;DATABASE=ZhiRui"
Conn.open ConnStr
else
Data=""&SitePath&"DataBase/"&DataName&""
on error resume next
Set conn = Server.CreateObject("ADODB.Connection")
connstr="dbq="+server.mappath(Data)+";defaultdir=;driver={microsoft access driver
(*.mdb)};uid=;password="&Psd()&";"
conn.Open connstr
end if
直接替换为
Data=""&SitePath&"DataBase/"&DataName&""
on error resume next
Set conn = Server.CreateObject("ADODB.Connection")
connstr="dbq="+server.mappath(Data)+";defaultdir=;driver={microsoft access driver
(*.mdb)};uid=;password="&Psd()&";"
conn.Open connstr
同时找到dataname的值