
Error when creating db on SQL-server 6.5
Thanx.
The dba had to turn up the available space on the 'master'.
Kenneth Solberg
I think you need to loop thru the errors collection in order to get all the errors/warnings/info messages. Anyway, you need to be in the master database in order to use the CREATE DATABASE statement, if this is not your default database fo the connection you can use "USE master" as the first part of your query.
Dim errLoop as ADODB.Error
Dim db As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rstSQL As New ADODB.Recordset
On Error GoTo Err_Test
db.Open "driver={SQL Server};server=test;" & "uid=sa;pwd="
db.Execute "CREATE DATABASE vb_test"
Exit Function
Err_Test:
For Each errLoop in db.Errors
MsgBox errLoop.NativeError
Next
Exit Function
--
VB-Joker
MCSE
Please post all replies to newsgroup!
But nothing is created on the SQL-server ?!
Kenneth Solberg
This is not an error, but merely an information message for your pleasure.
--
VB-Joker
MCSE
Please post all replies to newsgroup!
I run this code:
Dim db As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rstSQL As New ADODB.Recordset
(...)
db.Open "driver={SQL Server};server=test;" & "uid=sa;pwd="
db.Execute "CREATE DATABASE vb_test"
And I get the following error message:
Runtime Error message: "[Microsoft][ODBC SQL Server Driver][SQL Server]CREATE DATABASE: allocating 256 pages on disk 'master'"
What's wrong ???
Thanks in advance !!
Kenneth Solberg