The following samples illustrate SQL-DMO application development in C, C++, and Microsoft® Visual Basic®.
When you choose to install SQL-DMO sample files, the samples are installed to the \Mssql7\Devtools\Samples\Sqldmo directory.
All samples include a project file applicable to the language used. For C and C++ samples, the project files have been created by Microsoft Visual C++® version 4.2 and 5.0.
The Visual Basic samples have been created using Visual Basic version 5.0.
The SQL-DMO C and C++ samples have been built for Microsoft Windows® 95 and Microsoft Windows NT® 4.0 operating systems. For projects including makefiles, makefiles include project settings only for Intel® x86 and Alpha versions of Visual C++. They have not been compiled or tested on any other hardware platform supported by any other compiler.
For C and C++ sample compilation, the Microsoft SQL Server™ development files must be installed to obtain the SQL-DMO header files. After installation, set your compiler include directory path to contain \Mssql7\Devtools\Include so that the compiler can access the Sqldmo.h and Sqldmoid.h files.
In \Mssql\Devtools\Samples\Sqldmo | Description |
---|---|
\C\soc | C language sample. Creates an instance of a SQLServer object and calls the Connect member function. |
\Cpp\dmoping | C++ language sample. Uses the PingSQLServerVersion function to query a SQL Server installation. Illustrates using SQL-DMO in an environment containing multiple versions of SQL Server. |
\Cpp\Smartptr | C++ language sample. Illustrates SQL-DMO development using COM object support built into Visual C++ 5.0 |
\Cpp\socpp | C++ language sample. Creates an instance of a SQLServer object and calls the Connect member function. |
\Vb\Explore | Visual Basic sample. Illustrates using SQL-DMO to browse SQL Server configuration in an enterprise. |
\Vb\Idxtest | Visual Basic sample. Illustrates using SQL-DMO to build and test the benefit of SQL Server indexes. |