 鲜花( 0)  鸡蛋( 0)
|
connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
5 W! h) p0 f0 V* j+ ~" ? set conn=server.createobject("ADODB.CONNECTION")5 E2 n' X& T( i$ I- b
if err.number<>0 then
) i' C' O1 H! G2 d5 \- F; L7 S err.clear
4 L1 ^2 B- V5 T$ E4 }, a+ u4 l! s set conn=nothing$ i, h+ t- E- m4 u0 G
response.write "数据库连接出错!"
8 T# ]! j' a- ]0 L0 Q Response.End- {, j! ^+ V. d7 @. _6 {; d
else
, h }1 @. n! v8 s+ p9 ?& y conn.open connstr" H0 H3 {. }- k$ V6 h" g
if err then 4 N1 V* B# h9 ^- R6 l
err.clear" m1 c+ c% x3 v
set conn=nothing! k, G( ]; |4 v x V
response.write "数据库连接出错!"
5 h9 O( X* Y! O) G3 v Response.End
% _$ j' c5 T' W6 r; C* Q! W end if
; j0 w: r6 b1 m Q2 Y; e end if4 G- _$ \0 w2 W
看错了你的问题。有可能是你的server.mappath设置的问题。
1 Q! D# G h. M: |6 B( A9 C, j1 ]
[ Last edited by Ward on 2004-11-24 at 05:33 PM ] |
|