 鲜花( 0)  鸡蛋( 0)
|
connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
' g7 I4 y0 q; l: b set conn=server.createobject("ADODB.CONNECTION")+ E+ W8 D6 ~' Y5 {& C
if err.number<>0 then 6 c# j: k* e; ]0 X2 L! Z- s
err.clear
0 J2 \* u# f4 O$ Z* M set conn=nothing$ V! c" H* E7 m1 B+ f! u4 f
response.write "数据库连接出错!"
: f2 {" S1 O: y+ ]' v Response.End9 l5 n# L' u) z
else! Y5 S9 S( f6 k5 @8 c7 N* j! s
conn.open connstr, @" Q' S \+ y4 h8 ^( x* S1 O
if err then
4 M! F: @5 w3 t- F# \ err.clear8 Z8 J8 a% U4 e4 D
set conn=nothing) i( C: s3 v1 t
response.write "数据库连接出错!"
0 I3 ^8 k6 q3 E' u5 L Response.End
% ?# U# Y7 B1 t; R end if8 F& l5 d I7 |% H; N
end if
! Q6 E: T" q2 w0 S, ~看错了你的问题。有可能是你的server.mappath设置的问题。. u* W, d; y& E
, V, ^- E( H& ?; m
[ Last edited by Ward on 2004-11-24 at 05:33 PM ] |
|