end function Public function DbExists(byVal dbPath) p3 n b5 e/ C
’查找数据库文件是否存在
1 d) W. S- |7 s3 y$ Q On Error resume Next
* ^% s6 f1 q4 {) d" n* E- F Dim c( P# `1 f4 F ?( l8 l+ ?# M+ i6 Z
Set c = Server.CreateObject("ADODB.Connection"). P5 ^/ v& R. t
c.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbPath
- ^; `% ?) Q3 s' Q( |0 ~ If Err.number0 Then
" R" ]( F/ L' @ Err.Clear
3 c: Q- T/ c9 Z4 T! b DbExists = false' B/ v9 A4 w5 H" {
else/ [9 {: g1 V4 N6 W' e2 z& j/ \
DbExists = True7 t/ x$ u8 _5 w3 X
End If' m: \- Z; B- c. X) E; o
set c = nothing
: y+ X9 R; f2 O End function# y) B( V7 Q* y9 U' E# O
Public function AppPath()
+ y1 S6 z _$ d$ h6 E) J! u ’取当前真实路径
( A7 j2 Z7 q, b6 E/ A* C AppPath = Server.MapPath("./")
7 t5 w" W' E( C/ a8 o5 W3 D End function$ p. j' K, _8 i4 E: L9 {5 L) s
Public function AppName()
; B: b3 Q& K) C9 V ’取当前程序名称
1 i1 R7 T: {, h; O; }& f AppName = Mid(Request.ServerVariables("SCRIPT_NAME"),(InStrRev(Request.ServerVariables("SCRIPT_NAME") ,"/",-1,1))+1,Len(Request.ServerVariables("SCRIPT_NAME")))
2 c/ Q: V- m/ N) `/ {, v End Function5 K. S. }: x% X7 u
Public function DeleteFile(filespec)
, [- g# ?7 H$ d2 w5 W
; `0 {) n, L1 R( e ’删除一个文件 |