 鲜花( 0)  鸡蛋( 0)
|
connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" A! O% y4 h" }; e
set conn=server.createobject("ADODB.CONNECTION")
" \* w3 B7 \: m$ x0 a# \5 D# h if err.number<>0 then 7 P) s; L, ~% W9 r) \+ M
err.clear9 [/ L. ^4 ^# y& {$ F
set conn=nothing
5 V2 l" O% j4 _ response.write "数据库连接出错!"
* d' ^4 c3 T+ z: `# b Response.End% K( \, b$ R+ B9 V
else
6 { V5 B9 Z2 X' {- y; s& s conn.open connstr: S2 R) i, W1 {. m G
if err then
4 I' D8 c" V: r2 v+ p err.clear% A) R0 S& }! N* N* I) I5 X# h
set conn=nothing
9 I1 w$ i6 \+ L4 m) y. P+ m' T" ~ response.write "数据库连接出错!"
" J- W6 t+ T: c$ a& ^. Q) v Response.End ( ]3 n" d; m# G9 @1 \* R
end if: R4 V6 s, j$ L) p9 k
end if
4 N+ D# ]4 k9 |8 T, H看错了你的问题。有可能是你的server.mappath设置的问题。
, b. p+ B3 l; H% }7 E' m8 n0 l" @7 ?8 v
[ Last edited by Ward on 2004-11-24 at 05:33 PM ] |
|