connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" ! R+ q5 V: w* l/ t set conn=server.createobject("ADODB.CONNECTION") 1 i n3 f, z- a! U1 | if err.number<>0 then ' q& U2 C. Q* L err.clear $ V: |5 n. @, b- w8 V set conn=nothing7 l. _$ s8 }' @& u8 u
response.write "数据库连接出错!" ) O! Y! x* m B2 a5 ` Response.End $ M! h( o2 ?: e! Q else. ]! M; X( v4 n% g+ s( S& O
conn.open connstr * n8 u6 c) c7 C" y0 `- k! N if err then * j6 U- ~+ \/ k2 p" v2 ~+ k) s err.clear 3 g: i; Z/ o3 c' M set conn=nothing/ ?, p4 D$ V% V7 m" l" f
response.write "数据库连接出错!" 8 p0 s8 d5 p% _- U Response.End , [1 H6 a2 V C6 ]3 n end if 1 P d/ c$ W: G* j8 j6 m end if 0 b! Q/ C" g! X1 ~/ @4 N看错了你的问题。有可能是你的server.mappath设置的问题。4 z! c" I( m/ K x7 c. m7 a' j7 R) R
3 I; A q' W8 ^" r% T[ Last edited by Ward on 2004-11-24 at 05:33 PM ]
错误信息是:& X, h7 E- q% F8 U) F: }" x1 m- M
ADODB.Connection.1 error '800a0bb9' 3 g0 b: s% i8 r % k {) P" y5 ^7 ~) ]6 O2 KThe application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. ; O. i, J; B$ p& S7 L/ g