connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" $ ]# X5 ~2 {) x set conn=server.createobject("ADODB.CONNECTION")5 x" n$ O& L7 M1 z" t' t
if err.number<>0 then 9 N, R3 u+ V; A$ f( ?* T. e$ _' x3 I err.clear0 T) }* h" O3 O _ k" _ ^
set conn=nothing; c) m+ M P* o2 E$ K0 T
response.write "数据库连接出错!"8 a6 |6 F0 }7 u
Response.End 1 [8 B- o: `) A else ( Y' r) c' i& E9 E" h& j7 S conn.open connstr 0 u3 I* |3 x+ n/ i/ x& F if err then ; K/ a/ b/ E$ p
err.clear + h8 j7 m) D8 f: B Y/ w set conn=nothing ' r M8 L, d8 s; u2 G A- | response.write "数据库连接出错!"4 }7 K5 i6 G8 I. \
Response.End % e- ^. A) X5 }) Z: m
end if) T- |. x% G! u* Y% A3 D
end if6 D$ X. C6 m+ x/ A
看错了你的问题。有可能是你的server.mappath设置的问题。 0 {/ J# J! D, |' s8 b! U% ?6 k. R# v3 |
[ Last edited by Ward on 2004-11-24 at 05:33 PM ]
7 s1 R, L" C9 X9 p0 [The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. 0 A$ p3 r2 \% |+ `! I& d7 F: D