connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" 3 O. [+ [' F- d3 B set conn=server.createobject("ADODB.CONNECTION") - j+ x) F$ |$ g$ i- p6 f. j if err.number<>0 then 1 o1 T! y% D* K, L7 L" b' U
err.clear 3 S' {2 E- u6 `8 ^+ \ set conn=nothing3 e) @- _" ^" f& c. ^% B
response.write "数据库连接出错!"+ \1 L: H& P; y3 D' y$ p4 n
Response.End& }+ }5 r. U% j2 F5 h% h- ?5 J# q
else/ ?3 u& X! d1 l4 X+ w
conn.open connstr 4 b6 |2 ?2 W. |/ ]9 Q! t if err then 7 |# i6 a e% n0 G$ [, z3 S err.clear) I/ _7 T! }$ x3 e2 m- p$ C. L" b
set conn=nothing * ~5 P/ S2 @0 M/ o/ N0 W# f response.write "数据库连接出错!"* U3 o Y2 `+ P* x
Response.End " w$ A2 `8 m1 v
end if & M9 \- L' d- z7 W9 b end if 5 ]+ U' o$ k% ^4 i. a' K5 N( Q看错了你的问题。有可能是你的server.mappath设置的问题。 ; c6 K3 O& Q4 i2 J( E$ j% \; j: o" j
[ Last edited by Ward on 2004-11-24 at 05:33 PM ]
错误信息是:# t9 h4 J3 z6 @' a7 D2 f
ADODB.Connection.1 error '800a0bb9' / c1 n6 E6 R6 a7 d6 C1 s0 K! _) t9 N! o0 A+ v' t
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. w) Q; c ~: L7 g) r4 \