Hi Tracey,
I am entering into this because I still seem to be having problems creating the database after going through the "Create or Drop SQL Database" code. I know it is not a problem with the connection string as I have been able to connect and get a list of the existing databases there as a test.
I have the following code which just does not seem to work, are you or somebody able to assist?
Sub Test
Dim i, databaseName, commands, cmd
databaseName = "TestDatabase"
commands = Array("CREATE DATABASE " & databaseName)
',_
' "DROP DATABASE " & databaseName)
commands(commands.length) = "CREATE DATABASE " + databaseName
'commands(commands.length) = "DROP DATABASE " + databaseName
Set cmd = ADO.CreateADOCommand
cmd.ConnectionString =_
"Provider=sqloledb;" & _
"Data Source=nnnnnn;" & _
"Initial Catalog=KENTEST;" & _
"Integrated Security=SSPI"
cmd.CommandType = cmdText
i = 0
While i < UBound(commands) + 1
Cmd.CommandText = commands(i)
Call Cmd.Execute
i = i + 1
WEnd
End Sub
Regards,
Ken