connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" , U0 B; m2 A" H9 Y3 @4 _% G
set conn=server.createobject("ADODB.CONNECTION")( o m. c) q5 E# m: n6 \2 H) W
if err.number<>0 then + {8 w, s5 f4 e$ t( Q" }, X4 M5 ]
err.clear 7 h& {# J" `0 A" C/ z2 N set conn=nothing7 p2 b0 N% `- ]$ }( j! w: T- n. `
response.write "数据库连接出错!" 7 Y0 c( ^5 \3 M5 q5 s& C Response.End% B* K! t* I2 \& K9 R& E7 ]& G& r( h
else. v3 h& p' q' E1 j+ k
conn.open connstr- L' N/ ?! g5 ^1 Q% i9 X: O
if err then ; j+ @6 L+ S# S* ?
err.clear : v# Z# n3 T* c- ] set conn=nothing- Q2 e ~1 n' B7 y. W) L4 F
response.write "数据库连接出错!"1 f8 T. i0 l# h' o3 h
Response.End 2 t9 y/ e6 G* ^# q4 \ end if ) D: k+ ~- o9 r q& f: P end if 4 e) R% d& [) C) w9 P+ i, F4 A看错了你的问题。有可能是你的server.mappath设置的问题。/ @7 T" l( o3 s5 f
3 I. d' I! Z# M
[ Last edited by Ward on 2004-11-24 at 05:33 PM ]
错误信息是: ; ^! |9 m1 o# _2 \7 f/ zADODB.Connection.1 error '800a0bb9' 8 p1 f! @5 K, U0 m7 f
# f: D8 P* G9 |6 ~9 g$ T% ~
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. 9 ~5 c) K6 e! l