 鲜花( 0)  鸡蛋( 0)
|
connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" 9 V$ Y) u$ U/ b
set conn=server.createobject("ADODB.CONNECTION")4 d. Z5 ` t1 X2 \$ v
if err.number<>0 then
- e. U g5 {+ z err.clear4 W$ p( n% N& \9 P* i4 i& b8 W
set conn=nothing
3 R( [5 Q. |! Q$ @0 r4 h5 u% c( A- I" ] response.write "数据库连接出错!"5 j7 Q7 c% h, z4 `
Response.End
' b# M; }8 M5 ?) x else
9 J0 R: O' o8 j6 B4 u5 I conn.open connstr& {1 X. g+ s/ [! N2 V1 U# \4 @
if err then
# |8 h' l) ^$ \- j# F8 y" l err.clear
5 G0 k1 a( b$ M9 E( E8 S7 D set conn=nothing
8 O1 ]% `5 F1 c8 ~ response.write "数据库连接出错!"
5 f4 Y- B8 _' W+ ?* C1 i% a Response.End / F J# k; {, C
end if
. D, L* T. d5 v5 Q) C* ]& g/ b end if
+ v6 w3 |; L9 k. Z0 j5 b看错了你的问题。有可能是你的server.mappath设置的问题。5 B5 e) N/ Z8 [- H, |3 M& M
, X4 B4 @8 `; x7 o5 ?0 k[ Last edited by Ward on 2004-11-24 at 05:33 PM ] |
|