- Home
·
- Miscellaneous
·
- Start Learning developing SQL-NS applications. Invoking a dialog box for creating a new database
Start Learning developing SQL-NS applications. Invoking a dialog box for creating a new database
Start Learning developing SQL-NS applications. Invoking a dialog box for creating a new database
Rate Start Learning developing SQL-NS applications. Invoking a dialog box for creating a new database
(1(1 Vote))
'Make a reference to Microsoft SQL Namespace Object Library
'Put a command button over the form
'Type the code below in the click event of Command Button
'Install SQL Server 7.0 in your machine
Private Sub Command1_Click()
On Error GoTo Err_Handler
Dim objSQLNS As SQLNamespace
Set objSQLNS = New SQLNamespace
objSQLNS.Initialize "SQL-NS Application", SQLNSRootType_Server, "Server=.;UID=sa;Password=;", hWnd
Dim hRootItem As Long
hRootItem = objSQLNS.GetRootItem
Dim hDatabases As Long
hDatabases = objSQLNS.GetFirstChildItem(hRootItem, 4)
Dim objSQLNSobj As SQLNamespaceObject
Set objSQLNSobj = objSQLNS.GetSQLNamespaceObject(hDatabases)
objSQLNSobj.ExecuteCommandByID 23, hWnd, 1
Exit Sub
Err_Handler:
MsgBox Err.Description & " " & Err.Number, vbOKOnly, "SQL-NS"
End Sub
Start Learning developing SQL-NS applications. Invoking a dialog box for creating a new database Comments
No comments yet — be the first to post one!
Post a Comment