SQLTestC - SELECT Statement Processing

DB Library for C

DB Library for C

SQLTestC - SELECT Statement Processing

SQLTestc is a console mode version of the SQL Test example. The example issues a simple SELECT statement against the pubs database and prints the returned result set rows to the console.

Default Location

C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\DBLib\SQLTestC

  1. Open the Sqltestc.dsw in Microsoft® Visual C++® 6.0.

  2. From the Tools menu, choose Options, and then click the Directories tab.

  3. From the Show directories for box, choose Include files and Library files, and ensure that the following directories (as appropriate) are included:
    • Include files: C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Include

    • Library files: C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Lib
  4. Ensure that the hard-coded server name, user name, and password are correct.

  5. Compile the program.

  6. Open a Command Prompt window, and then change the current directory to C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\DBLib\Sqltestc.

  7. Run the program by entering "sqltestc".
Functions Illustrated
Dbinit dbuse
Dbmsghandle dbcmd
Dberrhandle dbsqlexec
Dblogin dbresults
DBSETLUSER dbbind
DBSETLPWD dbnextrow
DBSETLAPP dbexit
DBSETLVERSION DBDEAD
Dbopen  

See Also

Samples