SQL-DMO

Smartptr

The Smartptr sample illustrates using specific Microsoft® Visual C++® COM development features to reduce program source size and speed development.

Default Location

C:\Program Files\
Microsoft SQL Server\80\Tools\Devtools\Samples\sqldmo\cpp\Smartptr

Running the Sample
  1. Open the Smartptr.dsw workspace.

  2. Run the application.
Remarks

The sample shows:

The Smartptr sample is a console application.

Smartptr requires Visual C++ 5.0 or later. Project files for Visual C++ (.dsp and .dsw extensions) are included. In the project files, build configurations are defined for computers using Intel or compatible processors. All configurations create a multibyte character application.

Objects, Methods, and Properties Illustrated
CoCreateInstance QueryResults.ResultSets
Err QueryResults.Rows
Err.Description Release
Err.Error spSQLServer.Close
Err.ErrorMessage SQLServer
Err.Source SQLServer.ApplicationName
QueryResults SQLServer.Connect
QueryResults.ColumnName SQLServer.ExecuteWithResults
QueryResults.Columns SQLServer.HostName
QueryResults.CurrentResultSet SQLServer.LoginTimeout
QueryResults.GetColumnString SQLServer.NetPacketSize

See Also

SQL-DMO Samples