关于asp读写数据库的问题????????????????(3分)

  • 主题发起人 主题发起人 LitterTiger
  • 开始时间 开始时间
L

LitterTiger

Unregistered / Unconfirmed
GUEST, unregistred user!
在我的asp中
Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.Mappath("db.mdb")
有的时候在第二行出错
如下:
Provider 错误 '80004005'

无法指出的错误

*.ASP, 行19

最后一行是我写的*,
这是什么问题呢,有的时候正常。
???????????????????
 
连接用OLE DB 直连,不要通过odbc,这个效率高,兼容性好,不易出错,如:
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
      "Data Source=/somepath/mydb.mdb;" & _
      "User Id=admin;" & _
      "Password=;"
 
iis设置不对可能引起数据库访问错误
 

º click the banner, i dare you
º blah
º ?
º oh yeah
º www.lagoonamusic.com
º yeah, good site!
º ENGLAND!
º a nice site
º suk muh ***** fellas
º www.taftman.com
º oops, I guess I was thinking
out loud too
º oh man, pedifiles are losers
º oops,damn must stop thinking
out aloud
º i like boning small boys
º sloppycode.net
º =P
º testing
º rant rant rant!!!
º wham
º interesting --

8 users online




ASP + Access benchmark script
Here is the script used for the ASP and Access part of the benchmark tests, using a dsn-less connection.

<%
Dim Conn,RS,SQL,DSN

DSN = "DBQ=" &amp; Server.Mappath("benchmark.mdb") &amp; ";Driver={Microsoft Access Driver (*.mdb)};"
Set RS = Server.CreateObject("ADODB.Recordset")
Set Conn = Server.CreateObject("ADODB.Connection")

' Start time
Response.Write "Started: " &amp; Hour(Now()) &amp; ":" &amp; Minute(Now()) &amp; ":" &amp; Second(Now()) &amp; "<br>"

Conn.Open DSN
SQL = "SELECT * FROM table"
RS.Open SQL,Conn,1,2
Do While Not RS.EOF
i = i +1
RS.MoveNext
Loop

' End Time
Response.Write "Finished: " &amp; Hour(Now()) &amp; ":" &amp; Minute(Now()) &amp; ":" &amp; Second(Now()) &amp; "<br>"
Response.Write i &amp; " records found."
%>



 
iis 哪里摄制的不对呢?
 
主要是权限,没设好根本不能访问
 
后退
顶部