How To Deploy SQL Distributed Management Objects with the Visual Basic Package and Deployment Wizard (258157)



The information in this article applies to:

  • Microsoft Visual Basic Learning Edition for Windows 5.0
  • Microsoft Visual Basic Learning Edition for Windows 6.0
  • Microsoft Visual Basic Professional Edition for Windows 5.0
  • Microsoft Visual Basic Professional Edition for Windows 6.0
  • Microsoft Visual Basic Enterprise Edition for Windows 5.0
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0 SP3

This article was previously published under Q258157

SUMMARY

This article illustrates how to use the Microsoft Visual Basic Package and Deployment Wizard to successfully deploy a Visual Basic application that references the SQL-DMO library.

The following definition for SQL-DMO is found in Microsoft SQL Server Books Online:

SQL Distributed Management Objects (SQL-DMO) is a collection of objects encapsulating Microsoft(r) SQL Server(tm) database and replication management.

In Microsoft Visual Basic, if you set a reference to the SQL-DMO library, you can then use Visual Basic to view and modify database schemas and perform common database management tasks.

MORE INFORMATION

The SQL-DMO library consists of eight redistributable files. These files, with their default installation folders, are:

File NamePath
Sqldmo.dll\Mssql7\Binn\
Sqldmo.rll\Mssql7\Binn\Resources\1033\
Sqlresld.dll\Mssql7\Binn\
Sqlsvc.dll\Mssql7\Binn\
Sqlsvc.rll\Mssql7\Binn\Resources\1033\
Sqlwoa.dll\Windows\System32\
Sqlwid.dll\Windows\System32\
W95scm.dll\Mssql7\Binn\


These files must be deployed as part of any application that references the SQL-DMO objects. The Microsoft Visual Basic Package and Deployment Wizard does not recognize all the dependencies of the Sqldmo.dll file and therefore, does not automatically include all the necessary files.

For additional information about dependency (.dep) files, click the article number below to view the article in the Microsoft Knowledge Base:

228940 INF: VB .DEP Files not Available for SQL 7.0 Redistributable Components

In order to properly deploy the SQL-DMO library, you must add all the preceding files to the list of the Included Files dialog box of the Package and Deployment Wizard during the packaging phase. When you are prompted with the File Open dialog box, you will find these files in the folders listed in the preceding table.

In the Install Locations dialog box, set the Install Location of the Sqlwoa.dll file to $(WinSysPath). The other files will default to $(AppPath) and can be left unchanged.

NOTE: If you are installing the SQL-DMO Objects as shared, you may want to relocate the other components to a common location such as the Windows System Path as well.

Finally, the setup application must be instructed to register the Sqldmo.dll file. The Package and Deployment Wizard will not automatically register the file. To instruct the setup application to register this component, open the Setup.lst file that was generated with the package, and then edit the following line:

File7=@sqldmo.dll,$(AppPath),,,2/8/00 3:42:08 AM,2625536,2000.2.8.0

Add "$(DLLSelfRegister)", the instruction to register the dll, after the install location constant, as follows:
File7=@sqldmo.dll,$(AppPath),$(DLLSelfRegister),,2/8/00 3:42:08 AM,2625536,2000.2.8.0
NOTE: The file number, date, time and version number of your files may be different than the ones shown in the code sample.

Save the Setup.lst file. This completes the steps required to deploy the SQL-DMO Objects support files with your Visual Basic application.

REFERENCES

SQL Server Books Online; topic: "SQL-DMO"

SQL Server 7.0 Standard and Enterprise CD-ROM; Redist.txt

Modification Type:MinorLast Reviewed:7/1/2004
Keywords:kbAppSetup kbCodeSnippet kbDeployment kbhowto kbwizard KB258157 kbAudDeveloper