 鲜花( 0)  鸡蛋( 0)
|
connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" $ w" o& P& P# A7 ^* W3 ]
set conn=server.createobject("ADODB.CONNECTION")+ V0 b, y' k8 R" w# B5 H
if err.number<>0 then
5 l4 L8 h, F6 o$ J* I$ N err.clear
- t) p: N7 e. ?% P' E set conn=nothing
( ~! v. ~) }! O) z response.write "数据库连接出错!"
( ^3 c" ]7 Q+ }0 N2 C) t Response.End& u/ a* h+ m9 l& l' W7 O+ Y6 A
else
& ~( c9 a: ~1 u conn.open connstr4 G. d$ w0 y4 O7 b7 c8 n- e* S
if err then * G/ A4 {0 B( `/ K
err.clear& k& ^' x( f7 X& h" {# e! A6 B
set conn=nothing
2 l) v9 H3 G8 e3 Q/ f response.write "数据库连接出错!"
1 a2 c# g) L* u( Y" ]: I0 I/ B Response.End " W M1 `& B; x+ b
end if# z5 c- P, d* Y9 A
end if
$ N9 F& O! U- z, B, F. O: }9 j( Y看错了你的问题。有可能是你的server.mappath设置的问题。& S( U7 ^" I7 c5 g) G# y
* m. O) l- G: w! l$ y, f[ Last edited by Ward on 2004-11-24 at 05:33 PM ] |
|