connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" : c2 ]8 z- d! M; o
set conn=server.createobject("ADODB.CONNECTION")" r9 B' n; z: F5 O) n) `- m
if err.number<>0 then 5 Z# }& _2 L. j+ l) w err.clear1 H; P6 _! x9 Y3 k
set conn=nothing E3 G/ x2 u' f( I
response.write "数据库连接出错!" 3 r9 O7 i! a8 Z6 K7 X" \ Response.End7 u( W9 D5 V2 `7 V% J: s! y( s B
else - d( B! ]2 c: V" e' z7 l$ P conn.open connstr" |( F/ Q+ E' n, R
if err then 9 m* p6 x b X5 n0 @
err.clear * b- ^( k' \+ n' \# N# [; P set conn=nothing2 u" f) A: {3 W3 x. Q1 i# ^
response.write "数据库连接出错!"! X7 l- \! v) ^8 q
Response.End 8 M @# J" s3 f. |
end if + V% w6 J' K* a" ^3 Z end if ! b" M/ p. h+ ^5 F看错了你的问题。有可能是你的server.mappath设置的问题。 ) I# R. D3 d- F( V4 Z0 _1 S* g( t) }/ y4 ?
[ Last edited by Ward on 2004-11-24 at 05:33 PM ]
错误信息是: ( T/ X1 [, k# r2 c* i( mADODB.Connection.1 error '800a0bb9' 6 L2 ^4 w8 l4 ?$ W# } $ v6 U3 \- F. ]& I: Q: KThe application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. 9 B Z% Q, T+ |1 v: z
. r( Y- O5 Q. ]' ^7 ~
我也觉得是不支持ACCESS,不过租前曾专门电话问过,说可以啊。