|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ASP-SqlServer dynamic db creation
Hi,
I have a problem related to asp and sql server. I wana create sql server database ( a database, its tables and then insert data) dynamically in asp. is it possible? if so, how? looking for a solution. |
|
#2
|
||||
|
||||
|
Yes, it's possible, just use SQL-DDL.
You'll still have an issue with users, so you'll need to create them as well. You should spend sometime researching this first. Example: Code:
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Server=serverName;UserID=Username;PWD=password;Dat abase=;"
This creates the database
strCreateDatabase = "IF EXISTS (SELECT * FROM master..sysdatabases WHERE Name = 'DatabaseName') DROP DATABASE DatabaseName CREATE DATABASE MyDatabase"
Execute the statement
Conn.Execute(strCreateDatabase)
Conn.Close
Set Conn = Nothing
|
|
#3
|
|||
|
|||
|
Thanks
thanks memnoch, i try this and if any problme i face, i will post it.
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > ASP-SqlServer dynamic db creation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|