在线管理数据库 类(10)
Dim Ca
Set Ca = Server.CreateObject("ADOX.Catalog")
If Err.number<>0 Then
ErrMsg("无法建立,请检查错误信息<br>" & Err.number & "<br>" & Err.Description)
Err.Clear
CreateDBfile = False
Exit function
End If
call Ca.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & AppPath() & SavePath & dbFileName)
Set Ca = Nothing
CreateDBfile = True
End If
End function
'查找数据库文件是否存在
Private function DbExists(byVal dbPath)
On Error resume Next
Dim c
Set c = Server.CreateObject("ADODB.Connection")
c.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbPath
If Err.number<>0 Then
Err.Clear
DbExists = false
else
DbExists = True
End If
set c = nothing
End function
'取当前真实路径
Private function AppPath()
AppPath = Server.MapPath("./")
If Right(AppPath,1) = "\" THen
AppPath = AppPath
内容版权声明:除非注明,否则皆为本站原创文章。