Dim objServer As New SQLDMO.SQLServer
Dim objDatabase As New SQLDMO.Database


Private Sub Form_Load()
  objServer.Connect "(local)", "userSQLServer", "passSQLServer"
  objDatabase.Name = "iniNamaDBdiSQLServernya"
End Sub


Private Sub cmdCreateDB_Click()
 Dim dbFile As New SQLDMO.DBFile
 Dim dbLog As New SQLDMO.LogFile

 dbFile.Name = "db_Data"
 dbFile.PhysicalName = "c:\db.mdf"
 dbFile.PrimaryFile = True
 dbFile.FileGrowthType = SQLDMOGrowth_MB
 dbFile.FileGrowth = 1
 objDatabase.FileGroups("PRIMARY").DBFiles.Add dbFile

 dbLog.Name = "db_Log"
 dbLog.PhysicalName = "c:\db.ldf"
 objDatabase.TransactionLog.LogFiles.Add dbLog

 objServer.Databases.Add objDatabase
End Sub

note: kalo udah bisa bilang2 ya  :-)

salam
lis


 
____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

Kirim email ke