 鲜花( 0)  鸡蛋( 0)
|
connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" " `" G( `" r9 b8 _; e7 w
set conn=server.createobject("ADODB.CONNECTION")
% {# K7 d+ M5 j) Q6 H- J if err.number<>0 then
' P5 F/ n, U$ E( a L0 c7 ~ err.clear+ P' Z; F2 s( X* l8 M, f* L! F
set conn=nothing
& p% q5 J# s) {) X6 U response.write "数据库连接出错!": v1 v+ N/ p9 \9 `9 t
Response.End* N* J2 p+ `( \: w" U2 a
else& ?4 u2 [; j, k# S: v
conn.open connstr
8 d% o5 Y/ F5 L0 b5 x. `# T if err then ' |+ J3 \- d; X, J* Z3 J
err.clear
2 D9 _8 y# y1 x9 K set conn=nothing
" n! x5 u( {7 r6 g, C7 _' b' d response.write "数据库连接出错!"$ t5 N# H$ D- D3 T7 b9 i: b$ z% a
Response.End " q/ V9 D* H9 ?, W
end if+ J4 [/ b; P* `0 @
end if/ _0 I! [+ q) S" _! ~
看错了你的问题。有可能是你的server.mappath设置的问题。% C D& l' z8 ]& r& f
9 a5 c" w+ \* K9 `% e3 u, ~[ Last edited by Ward on 2004-11-24 at 05:33 PM ] |
|