I'm trying to determine if a database of a certain name exists and then create it if it does not. Ideally this would be in VBScript. I currently am trying using a loop search of an array but the total number of databases will change greatly.
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