在线管理数据库 类(9)
'建立新表
Public Function CreateTable(ByVal TableName,ByVal FieldList)
Dim StrSql
If sDBType = "SQL" THen
StrSql = "CREATE TABLE [" & TableName & "]( " & FieldList & ")"
Else
StrSql = "CREATE TABLE [" & TableName & "]"
End if
RLConn.Execute(StrSql)
If Err.Number <> 0 Then
Call ErrMsg("新建 " & TableName & " 表错误,原因" & Err.Description & "")
Err.Clear()
CreateTable = False
Else
CreateTable = True
End If
End Function
'---------------------------------------数据库操作-----------------------------------------------
'建立数据库文件
Public function CreateDBfile(byVal dbFileName,byVal SavePath)
On error resume Next
SavePath = Replace(SavePath,"/","\")
If Right(SavePath,1)<>"\" Or Right(SavePath,1)<>"/" Then SavePath = Trim(SavePath) & "\"
If Left(dbFileName,1)="\" Or Left(dbFileName,1)="/" Then dbFileName = Trim(Mid(dbFileName,2,Len(dbFileName)))
If DbExists(AppPath() & SavePath & dbFileName) Then
ErrMsg("对不起,该数据库已经存在!" & AppPath() & SavePath & dbFileName)
CreateDBfile = False
Else
Response.Write AppPath() & SavePath & dbFileName
内容版权声明:除非注明,否则皆为本站原创文章。