 鲜花( 0)  鸡蛋( 0)
|
connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
& Z/ \0 U% H2 }3 a: v set conn=server.createobject("ADODB.CONNECTION")5 N, a( x$ D' O \8 B2 Q8 f
if err.number<>0 then
2 |1 f$ M- V5 k err.clear6 t( N. Y3 y, J
set conn=nothing H' _9 m5 M+ v" p' c7 u2 t
response.write "数据库连接出错!"
; J6 {1 a5 {, X# |9 }7 ^ Response.End' E" E1 [1 g; H! i
else( E9 f. L4 q6 F& S5 e4 }+ Q' e* L
conn.open connstr
; |7 i$ X; T4 [. w0 E2 E' T* t if err then 5 R8 f1 n/ d- n
err.clear# ?: a$ u1 y& P
set conn=nothing3 z6 X) J2 e$ ^) Q- J, f
response.write "数据库连接出错!"- ]5 z" ]# w& a: g! P, ^
Response.End + M8 b- J/ y, o# j6 R0 b0 H) s
end if
2 z* e& s/ ]" k3 n% O8 r end if
# d2 C3 O, C- K3 R& K: S* B看错了你的问题。有可能是你的server.mappath设置的问题。0 }5 l) U5 u% {, z1 z) T: \
4 t' M5 v* Z) t" ]& o
[ Last edited by Ward on 2004-11-24 at 05:33 PM ] |
|