VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Creating Sql Server DataBase

by Sivabalan.D (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 27th August 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Creating Sql Server DataBase

API Declarations


Dim MyServer As New SQLServer
Dim DataBase As New SQLDMO.DataBase
Dim DBFileData As New SQLDMO.DBFile
Dim LogFile As New SQLDMO.LogFile
Dim StrSuccess As String
Dim User As New SQLDMO.User

Rate Creating Sql Server DataBase



If Trim(TxtServer.Text) <> "" And Trim(TxTUser.Text) <> "" Then
    DataBase.Name = "USMte" 'Ur DataBase Name
    DBFileData.Name = "USMte"
    DBFileData.PhysicalName = "c:\USMte.mdf"
    DBFileData.PrimaryFile = True
    DBFileData.FileGrowthType = SQLDMOGrowth_MB
    DBFileData.FileGrowth = 1
    DataBase.FileGroups("PRIMARY").DBFiles.Add DBFileData
    LogFile.Name = "USMteLog"
    LogFile.PhysicalName = "c:\USMtelog.ldf"
    DataBase.TransactionLog.LogFiles.Add LogFile
    MyServer.Databases.Add DataBase
    MyServer.Disconnect
    MsgBox "Created"
End If
End Sub

Download this snippet    Add to My Saved Code

Creating Sql Server DataBase Comments

No comments have been posted about Creating Sql Server DataBase. Why not be the first to post a comment about Creating Sql Server DataBase.

Post your comment

Subject:
Message:
0/1000 characters