SQL-NS applications. Invoking a general SQL script dialog box
SQL-NS applications. Invoking a general SQL script dialog box
Rate SQL-NS applications. Invoking a general SQL script dialog box
(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 hDatabase As Long
hDatabase = objSQLNS.GetFirstChildItem(hDatabases, 5, "Pubs")
Dim objSQLNSobj As SQLNamespaceObject
Set objSQLNSobj = objSQLNS.GetSQLNamespaceObject(hDatabase)
objSQLNSobj.ExecuteCommandByID 79, hWnd, 1
Exit Sub
Err_Handler:
MsgBox Err.Description & " " & Err.Number, vbOKOnly, "SQL-NS"
End Sub
SQL-NS applications. Invoking a general SQL script dialog box Comments
No comments yet — be the first to post one!
Post a Comment