ASP数据库调用问题,把调用MSSQL数据库换成调用MDB数据库。
<%Response.Buffer=trueEnableSessionState=falseDimConn,StartTimeStartTime=Timer()'SubC...
<%
Response.Buffer = true
EnableSessionState = false
Dim Conn,StartTime
StartTime = Timer()
'Sub ConnectionDatabase
on error resume next
'Dim Db,ConnStr
'Db="/Db/wionls32ds89.mdb"
'Set conn=Server.CreateObject("ADODB.Connection")
'ConnStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath(Db)
'Conn.Open ConnStr
dim connstr,db,pass_word,User_ID,Data_Source
db="3892934091"
Pass_word="42900afsaw129"
User_ID="3892934091"
Data_Source="localhost"
Set conn = Server.CreateObject("ADODB.Connection")
connStr="Provider=SQLOLEDB.1;Password='"&pass_word&"';Persist Security Info=True;User ID='"&User_ID&"';Initial Catalog='"&db&"';Data Source='"&Data_Source&"'"
conn.Open connstr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
'End Sub
%>
把调用MSSQL数据库换成调用MDB数据库。调用成功后,可以追加分。 展开
Response.Buffer = true
EnableSessionState = false
Dim Conn,StartTime
StartTime = Timer()
'Sub ConnectionDatabase
on error resume next
'Dim Db,ConnStr
'Db="/Db/wionls32ds89.mdb"
'Set conn=Server.CreateObject("ADODB.Connection")
'ConnStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath(Db)
'Conn.Open ConnStr
dim connstr,db,pass_word,User_ID,Data_Source
db="3892934091"
Pass_word="42900afsaw129"
User_ID="3892934091"
Data_Source="localhost"
Set conn = Server.CreateObject("ADODB.Connection")
connStr="Provider=SQLOLEDB.1;Password='"&pass_word&"';Persist Security Info=True;User ID='"&User_ID&"';Initial Catalog='"&db&"';Data Source='"&Data_Source&"'"
conn.Open connstr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
'End Sub
%>
把调用MSSQL数据库换成调用MDB数据库。调用成功后,可以追加分。 展开
3个回答
展开全部
换成下面的,即可:
<%
Response.Buffer = true
EnableSessionState = false
Dim Conn,StartTime
StartTime = Timer()
'Sub ConnectionDatabase
on error resume next
dim conn
dim connstr
dim db
db="/Db/wionls32ds89.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
conn.Open connstr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
'End Sub
%>
<%
Response.Buffer = true
EnableSessionState = false
Dim Conn,StartTime
StartTime = Timer()
'Sub ConnectionDatabase
on error resume next
dim conn
dim connstr
dim db
db="/Db/wionls32ds89.mdb"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
conn.Open connstr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
'End Sub
%>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2009-11-17
展开全部
esrwedwfwr
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2009-11-29
展开全部
'Set conn=Server.CreateObject("ADODB.Connection")
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询