我想確定某個特定名稱的數據庫是否存在,然後如果它沒有創建它。理想情況下,這將在VBScript中。我目前正在嘗試使用數組的循環搜索,但數據庫的總數會發生很大變化。MySQL檢查數據庫是否存在
set dbQuery = ConnSQL.execute(checkDBsql)
if dbQuery.BOF and dbQuery.EOF then ' Query didn't return any records.
ConnSQL.execute(MakeDb)
else
dbQuery.MoveFirst
i = 0
Do While Not dbQuery.EOF
i = i + 1
loop
end if
set dbQuery = ConnSQL.execute(checkDBsql)
if dbQuery.BOF and dbQuery.EOF then ' Query didn't return any records.
msgBox "ERROR!"
else
e = 0
do while not dbQuery.EOF
DBName(e) = dbQuery("Database")
e = e + 1
loop
For a = 1 to UBound(DBName)
If DBName(a) = OldDBName Then
MsgBox DBName(a)
end if
Next
connSQL.close
模式給了一個錯誤,但該信息,如果不存在部分的創建數據庫是什麼,我要怎樣做。我一定錯過了。 – MrGrant 2010-09-08 22:45:20