 鲜花( 0)  鸡蛋( 0)
|
connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" / z- T5 n5 o/ Y7 m# N
set conn=server.createobject("ADODB.CONNECTION")
, y/ k4 q, |% f. r if err.number<>0 then
/ r g% C$ M9 y, r: k- i2 u err.clear
5 l* j: i4 n4 K* p; _4 R set conn=nothing4 d4 D1 n U7 m0 L4 B/ R
response.write "数据库连接出错!"
- f8 R- P, k. U+ L3 c* Z$ L0 N Response.End
% l3 I% ~6 W+ f9 j% | else0 Q8 B- \5 ~/ P) b* R- K/ E# @; }
conn.open connstr! u, g* a' c, `; q* k: u: \, M: k# U
if err then ! P2 z& [2 J* q' U; K& Y
err.clear' d) b3 _( t0 Z+ f3 l
set conn=nothing
) v8 e# s$ b" T" P4 n$ S0 ` response.write "数据库连接出错!"5 P* l( `( y! X8 Q- W0 K
Response.End
7 i }& b9 n8 Q$ c/ w( j0 V end if
% ~% d5 a U. S e# C# _( I0 ] end if
( T5 f, H- q1 j X) `2 R看错了你的问题。有可能是你的server.mappath设置的问题。5 R1 R8 j" W a8 ?4 O
% W6 P9 E) y$ d( ?, |[ Last edited by Ward on 2004-11-24 at 05:33 PM ] |
|