connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" 3 D+ y. T s: T' J& ~+ s$ |5 ^
set conn=server.createobject("ADODB.CONNECTION")! w( P% E# g, e7 _1 P' v& v# x
if err.number<>0 then ) g% Q' X. U" j z
err.clear. ^& X( _' R4 l4 K; u6 x0 t
set conn=nothing9 Z! m- X3 {" X5 T% L. M
response.write "数据库连接出错!"& }) } I% G2 t& |* C. C
Response.End - R# L6 G1 n6 U Q else 9 h0 ]% m2 J) `+ z conn.open connstr1 j. N& B& d% i. F8 M( d
if err then / } L1 ?5 H' w6 Y/ ]% {
err.clear2 ]1 Q, h. l6 z; x( v: |8 a5 U
set conn=nothing1 p( x& l. f* o
response.write "数据库连接出错!"+ C0 u% f0 M& }
Response.End - l* U( H7 |2 a" o end if5 V8 @$ d) c3 {5 m. i/ @$ |0 i3 x
end if 1 y2 n8 z. a$ E; }8 r看错了你的问题。有可能是你的server.mappath设置的问题。 $ i: c. f! u, {3 O+ r. L" h8 S, d! M( j
[ Last edited by Ward on 2004-11-24 at 05:33 PM ]
错误信息是:8 H( h, }% p1 d1 @) C7 T2 x
ADODB.Connection.1 error '800a0bb9' ! H: s. ~1 o5 J4 ^9 ^8 {
( A& N( O' K2 s7 r- D. ~, a' B( Z6 P
The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another. 3 w5 M X' ]" r" ^7 k0 y/ ^0 q% A2 h. B! n6 {- w- `+ w6 N
我也觉得是不支持ACCESS,不过租前曾专门电话问过,说可以啊。