M
Matt
I need to be able to test an already started MSDE/SQL server for a
specific database. If that database doesn't exist, I want to create
it.
I have the following statement someone provided on site, but if I
can't connect to the database, how can I execute the sql command?
Dim sql As String = "CREATE DATABASE mydb ON PRIMARY" +
"(Name=test_data, filename = 'C:\mysql\mydb_data.mdf', size=3," +
"maxsize=5, filegrowth=10%)log on" + "(name=mydbb_log,
filename='C:\mysql\mydb_log.ldf',size=3," + "maxsize=20,filegrowth=1)"
If I try to connect with the following string, it fails and I can't
execute the sql string above, of course.
ConnectionString = "UID=sa;PWD=pass;" + "Initial Catalog=mydb;" +
"Data Source=localhost;"
Thanks much for any help you can offer.
specific database. If that database doesn't exist, I want to create
it.
I have the following statement someone provided on site, but if I
can't connect to the database, how can I execute the sql command?
Dim sql As String = "CREATE DATABASE mydb ON PRIMARY" +
"(Name=test_data, filename = 'C:\mysql\mydb_data.mdf', size=3," +
"maxsize=5, filegrowth=10%)log on" + "(name=mydbb_log,
filename='C:\mysql\mydb_log.ldf',size=3," + "maxsize=20,filegrowth=1)"
If I try to connect with the following string, it fails and I can't
execute the sql string above, of course.
ConnectionString = "UID=sa;PWD=pass;" + "Initial Catalog=mydb;" +
"Data Source=localhost;"
Thanks much for any help you can offer.