connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" - p' [3 `& S, t2 k4 B- a: ~8 G% b
set conn=server.createobject("ADODB.CONNECTION") ! Z- H* M. k3 b% s if err.number<>0 then ) L [) W- D1 t9 v0 G
err.clear 4 \4 q' E# B, J& s( c1 p set conn=nothing 6 w* b8 e7 t2 a response.write "数据库连接出错!"$ c; l6 n2 L/ h C; ]8 F O
Response.End + }5 Q. Q0 R K1 k else/ M+ p7 W1 M6 S$ `* k
conn.open connstr + _- y4 |* U- U if err then 9 F9 O3 w: Q" f- r% [: b err.clear, \# d& G3 o: S) \6 d
set conn=nothing ' U; m; ^( S& j response.write "数据库连接出错!"0 g. ~0 \- I! E2 @
Response.End 6 |6 ^5 w) C! b
end if + q) C* V2 @2 p& t7 C end if 2 C2 U* b8 H% R8 I& s看错了你的问题。有可能是你的server.mappath设置的问题。 / N# g3 ^% i. E X " i5 }- c; e: V$ T[ Last edited by Ward on 2004-11-24 at 05:33 PM ]
错误信息是:9 D8 O! B- D, r1 n" p! x
ADODB.Connection.1 error '800a0bb9' ' O% T% k8 ^: ~' z : T7 t' M- y+ R4 \$ R7 t4 h& fThe application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. 1 k r3 s' j$ b% x ; l7 V6 ~& x. P9 N9 ^! {: Y' Z我也觉得是不支持ACCESS,不过租前曾专门电话问过,说可以啊。