 鲜花( 0)  鸡蛋( 0)
|
connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" - F/ D1 [4 g6 z2 {% s1 o' r# O
set conn=server.createobject("ADODB.CONNECTION")
. s4 n$ T4 u3 P" o6 T% s! F if err.number<>0 then
/ h+ a* [3 E( U err.clear% L- _0 }7 @! U3 J [7 n
set conn=nothing/ k9 x; S1 d! Q( F9 o
response.write "数据库连接出错!"! W- R: o7 ?& q0 _' j& x [5 z
Response.End
& \4 i- t' g* n4 y7 ? else ]/ Z# _, P: [( q* H5 l
conn.open connstr
9 d" R4 s* Z4 G/ o; E( S5 t if err then 8 d0 V' t7 r) s3 f, D( f& C2 i/ p
err.clear6 ~ Y8 C/ D- V& h/ L8 j/ N
set conn=nothing9 Y7 s+ @+ y" Z, A: T
response.write "数据库连接出错!"
3 X% G9 e* u8 D0 ^9 J Response.End * @% X4 N0 r; u; T+ K# \3 E5 C
end if! M( ~; K r- U
end if1 ~. o) T, l4 O
看错了你的问题。有可能是你的server.mappath设置的问题。% y7 _( N! o, J& T3 }0 B
# r, D) b; A0 ^, P2 p* C[ Last edited by Ward on 2004-11-24 at 05:33 PM ] |
|