connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" - P$ r6 n( V5 d# Y set conn=server.createobject("ADODB.CONNECTION")* L6 k. `5 n) p7 m/ N }
if err.number<>0 then & D# y* c1 h9 t+ ?: ~ err.clear( ~& k8 Z8 K9 W$ X' |* }% s V
set conn=nothing9 ^8 U$ [) }1 w/ M
response.write "数据库连接出错!" " A- E% _# g. J) |3 ? {% f' K Response.End ( o. i& q: {. v% p else % H4 X8 A5 a% S2 z% S conn.open connstr) p5 |* E5 N [
if err then 3 v- b4 c' U2 H; e# E, h
err.clear1 G1 ?- D. n; Q# H
set conn=nothing ( U+ a% ?! x+ `8 K response.write "数据库连接出错!" - S8 p) K6 x2 ^* b2 t, r! ^$ R Response.End : D2 \# _8 \, ~( n
end if v3 I# |/ P8 d8 R* t" x end if3 v0 O8 g; m7 u ?) i$ z
看错了你的问题。有可能是你的server.mappath设置的问题。 2 w& a' X9 K! s& U* E ! i4 V* n- b* \& `* b8 a[ Last edited by Ward on 2004-11-24 at 05:33 PM ]
错误信息是:* z. W! d8 a$ g U! J, k, x
ADODB.Connection.1 error '800a0bb9' ( R& N9 ?* B: J9 E6 u+ ^. T $ a# z# D) d7 nThe application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. h B E7 h6 |% A: H" x