connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" ! y5 G# \1 F& |2 |. k6 Z set conn=server.createobject("ADODB.CONNECTION") 5 U9 C. G) D# y' }' e. v; Z if err.number<>0 then 3 S; v% R; f6 w+ x err.clear0 u5 R! k- s' j3 H& r
set conn=nothing 7 M. j" h- S: Q" N, \7 H response.write "数据库连接出错!"9 u+ X L/ O9 F! t+ E
Response.End+ n9 N5 \: o& P7 K9 K. e
else: z! ]( l( o8 g
conn.open connstr. a) \- C$ S% Q r
if err then 0 j% }+ m: z% N1 p
err.clear( h) ~$ S; R' j3 b" e& N
set conn=nothing. ^; T# \" U& ~. [4 T
response.write "数据库连接出错!" ; v* [" J0 g K) Q. C% H" r. \ Response.End 8 D. I1 [6 M Z! x) u* |# z
end if 7 U5 t. o$ i% g8 o1 t end if 9 a# W0 u7 A* m* f. c( r9 P6 j看错了你的问题。有可能是你的server.mappath设置的问题。: G( p! ^# J3 C& l+ i1 ^4 \4 p4 i/ h
: g# d: j! K6 X3 T- d, Y[ Last edited by Ward on 2004-11-24 at 05:33 PM ]
错误信息是:6 X7 v/ L4 w9 ?
ADODB.Connection.1 error '800a0bb9' * Q0 \# B S5 t7 Y( O- y9 o! d4 _- F9 W& I2 J/ M. _. g
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. 0 Y" Z" x/ X1 m. T