|
-
May 4th, 2000, 04:40 PM
#1
Thread Starter
Member
How can i create a database in SQL server from vb
-
May 4th, 2000, 07:28 PM
#2
Fanatic Member
Hi gorthims
To create A new database IN VB you have to do it in two sections.
Firstly if you want to use new devices for the database you need to do the following.
Set a connection to the server then use the following code
myconnection.execute "DISK INIT Name = `NewDevice'," & _
"PhysName = `C:\SQL65\DATA\NewDevice.DAT'," & _
"VDevNo = 6," & _
"Size = 2500"
This Will only work in SQL6.5 And not seven but if you are using 7.0 and I remember correctly, seven automatically creates the devices for you
Next
Once the deivices are created or if you want to use existing ones use the follwing code
myconnection.execute "CREATE DATABASE database_name" & _
"[ON {DEFAULT | database_device} [= size]" & _
"[, database_device [= size]]...]" & _
"[LOG ON log_device [= size]" & _
"[,log_device[= size]]...]" & _
"[FOR LOAD]"
Most of those options speak for themselves but you can look in books-online for further information.
And there you have it one brand new spanking database sitting on your server.
Finally you can use the create table statement to yes, youve got it , craete tables for your new database.
If you need any more help, reply back
Hope this helps 
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
May 4th, 2000, 08:50 PM
#3
Thread Starter
Member
ThanQ Ianpbaker
This will help me.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|