 鲜花( 0)  鸡蛋( 0)
|
connstr = "DBQ=" + server.mappath("yourdatabase") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
" T- H$ B7 c( D. o. q. X5 y set conn=server.createobject("ADODB.CONNECTION")! Q3 E9 E v" P: M
if err.number<>0 then - D8 k3 R7 s* y% s3 ^/ t+ |
err.clear
& q& @$ e% o& i: D set conn=nothing4 X& |; f, O" L- C: `/ U
response.write "数据库连接出错!"/ o3 F1 P! V, i$ B# O: U8 B
Response.End, T& c5 d9 m, e& n8 f
else
" @* E) \% J. c6 ]# E conn.open connstr. _! @/ u' O# k, H, S+ T! t r( C8 H
if err then 6 }. T; a9 S$ y$ l
err.clear
8 v7 {8 c3 c; z set conn=nothing9 p1 J. y+ W, R8 j% g
response.write "数据库连接出错!"
' B$ J% @# |5 T Response.End 4 Q$ _9 p! e' @; {/ q8 m6 h
end if
; J7 s" R$ T* E( ~ ^0 I d end if
8 j& @; j8 g! Q1 c5 C* ?' u看错了你的问题。有可能是你的server.mappath设置的问题。
5 U$ K1 ]: V8 A2 Y- E& q$ m) p* g$ u: N/ P- V# t/ J- F
[ Last edited by Ward on 2004-11-24 at 05:33 PM ] |
|