connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" # y* R4 o( |! C# H ^
set conn=server.createobject("ADODB.CONNECTION") ! e |8 B- D1 z4 G3 C3 g4 N Y } if err.number<>0 then ! P# A5 l; n3 y err.clear6 d7 m5 f' W" g9 Y
set conn=nothing % S0 E6 x" Z5 @# p& u. ]. s( _ response.write "数据库连接出错!") P Q! J+ ], P: Q& F
Response.End & {+ S, T6 @" T' c" O else8 Q% @5 H& d( W- w
conn.open connstr : o1 @2 ?4 j: Y: [; P; ?, K if err then 0 o" {- O! c; m0 Z err.clear2 V2 X2 w. ^2 B; }6 x
set conn=nothing* s0 p2 d6 x' C! g) ^: K3 Z
response.write "数据库连接出错!" ! A) r H4 m4 k Response.End ; U/ Y& S& j) _3 V+ R end if 1 O* P1 g3 h( R4 Y* g3 g end if 3 y2 B6 L4 I1 u+ O. J看错了你的问题。有可能是你的server.mappath设置的问题。 1 V2 W- R" G5 M& L- R# K; y" {- T: J* {, Y- b9 B
[ Last edited by Ward on 2004-11-24 at 05:33 PM ]
错误信息是:$ h, s& Y- @- ?# j8 s" u
ADODB.Connection.1 error '800a0bb9' % V7 d: K7 R5 ^- A) ^' Z( D
k B9 h+ E# U: G. ?The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. 5 E1 [: j" T7 W7 g8 s
- N- s0 n) `+ [2 e, l( N我也觉得是不支持ACCESS,不过租前曾专门电话问过,说可以啊。