 鲜花( 0)  鸡蛋( 0)
|
connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" - [) L8 p4 f5 p2 X9 _
set conn=server.createobject("ADODB.CONNECTION")5 X* l0 T! m' e! w2 q! [
if err.number<>0 then ! ]. r, o' {! Z. N+ _2 g. L& P5 y
err.clear' r, S! e% X9 n) O3 f
set conn=nothing
E' D5 [- F' n# O: Q; _ response.write "数据库连接出错!"
9 K* P2 ^, s% N F7 ^2 a/ C Response.End
% G1 ]/ I# F0 _! O, {( C& D else h* w$ V, i; V6 B: P8 j
conn.open connstr
% ^0 x$ k! E8 U- _$ `0 J if err then 2 _, [) b0 e% W W
err.clear
$ l1 U- m4 T* n: n% K2 j set conn=nothing
' T& g% [6 P7 ~/ g; |& Y response.write "数据库连接出错!"
' m2 J: P5 Y% }- ~ Response.End
6 L6 s% Z9 M& S2 @, s4 D* N0 g end if, j$ m# V; G5 H( p" E! s# D4 y
end if/ l& o+ B: n. D w
看错了你的问题。有可能是你的server.mappath设置的问题。
6 |- \* [! q1 L
8 ^5 M* M! S5 P% R3 s[ Last edited by Ward on 2004-11-24 at 05:33 PM ] |
|