SQLTestN

DB Library for C

DB Library for C

SQLTestN

SQLTestN is a Win32® API, graphical user interface sample. The sample illustrates connecting to a Microsoft® SQL Server™ and executing a simple SELECT statement.

Default Location

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

  1. Open the sqltestn.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 user name is correct. The password is assumed to be NULL.

  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\Sqltestn.

  7. Run the program by entering "sqltestn".
Functions Illustrated
Dbbind dbmsghandle
Dbclose dbnextrow
Dbcmd dbopen
Dberrhandle dbresults
Dbexit DBSETLUSER
Dbfreelogin DBSETLVERSION
Dbinit dbsqlexec
DBLOCKLIB DBUNLOCKLIB
Dblogin dbuse

See Also

Samples