 鲜花( 0)  鸡蛋( 0)
|
connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};" + d" c7 G6 E9 {& f0 ?% o
set conn=server.createobject("ADODB.CONNECTION")% T: E; R3 y& w4 ?' J/ _
if err.number<>0 then
& h- \4 ?8 f( q; N; ]" E3 w2 _ err.clear
2 k* Z! y+ M: [" i( @! t set conn=nothing
1 Z. z& j. q/ C2 m* m' U response.write "数据库连接出错!"
' P/ |5 B2 z0 H* s Response.End
7 W9 W, b+ |. m- s6 d else
' f3 }8 O9 B- H9 K conn.open connstr M- x! [: l0 h& y
if err then
, _2 q7 ?2 a5 v$ v( ?: ~. x4 e# { err.clear4 o, M$ }* y3 ?- H7 Y, u
set conn=nothing
4 ^. ~, |* E5 G+ ] response.write "数据库连接出错!"
# B' N) M& C/ \0 W* p1 g( }7 c Response.End
! Y" w. a0 U. W end if
5 p; r" `1 ]5 E; |/ T end if# D2 s- c0 J' r& M( O3 R& b
看错了你的问题。有可能是你的server.mappath设置的问题。3 c+ B4 J8 s G. b# _ b6 e
% d. D h) D Q2 P- q[ Last edited by Ward on 2004-11-24 at 05:33 PM ] |
|