connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" 0 F: ^$ D3 F- I6 r! B
set conn=server.createobject("ADODB.CONNECTION")8 C6 s& k% v1 U7 m! B: |5 ]6 C' X
if err.number<>0 then " z8 v) z6 F. _6 D) g err.clear % z6 H6 _% `# A v+ s set conn=nothing # W$ y* z) D; ~) y- V& ^ response.write "数据库连接出错!" * l* S$ }. e! |2 i4 m# b Response.End: j2 o" Y2 l0 T% n) ?
else : @: ?/ t3 h3 p m( B f conn.open connstr ' q! X/ g9 q! o if err then ( i" \) n A$ J& B( z! R8 `
err.clear3 Q! W/ e1 j" f$ A
set conn=nothing . D, q2 {% u' h7 S7 G3 o* W2 X& ^ response.write "数据库连接出错!" ) D a, i2 W. f$ M0 c) g5 [ Response.End ! u2 @: u+ l. j6 P( { end if$ q5 e4 ?& S# X
end if 2 o4 X9 k+ R y& N3 {( `看错了你的问题。有可能是你的server.mappath设置的问题。 * A8 q k& C' a; L% ^, v. x, H# G
[ Last edited by Ward on 2004-11-24 at 05:33 PM ]
错误信息是:. |5 k; _7 w3 R7 \
ADODB.Connection.1 error '800a0bb9' # a9 W( u' w1 S* f# ]( c, s# j: ?6 G9 a6 N5 l2 P6 r* s
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. * x4 U4 V: A" I& Z