connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" ; L8 I- E) |( |8 }( Z set conn=server.createobject("ADODB.CONNECTION")$ r. h$ Q3 F( W+ a1 o5 ~5 w
if err.number<>0 then 8 E1 O. M$ j% b err.clear 8 P* [- O2 T4 B8 q0 i set conn=nothing. @- ~. S% v: E3 S
response.write "数据库连接出错!" * q, q- f2 d f9 ^( C( I7 Z5 z Response.End' K8 `4 T7 \: J6 K I+ i
else7 D) |5 k. N- L- m% K
conn.open connstr6 _" |9 E. S( Y. K' C
if err then ( L- T5 Y) k; x' C$ a err.clear3 I: H- `7 Z6 p5 [& `9 }6 K% H
set conn=nothing - H% Q: U1 L' p9 W7 q" S6 q, ? response.write "数据库连接出错!"7 B! i9 c- v. C1 p( G8 n
Response.End ( O& n+ `' v9 o6 r
end if 3 w G C7 a& e7 u8 m end if ; V; Y8 o; [$ j# ]$ f. M看错了你的问题。有可能是你的server.mappath设置的问题。 ( `! W/ [$ f; Z) h- N. G' X ( c* e+ Z0 x9 K4 X[ Last edited by Ward on 2004-11-24 at 05:33 PM ]
错误信息是: + O$ d+ F" Z% J# g- zADODB.Connection.1 error '800a0bb9' ( O5 l1 _! a- E3 ?1 i
# v5 A8 ?% b6 B9 K* w, ~) L
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. " d/ w U, _% y1 B$ b