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
- Open the Sqltestc.dsw in Microsoft® Visual C++® 6.0.
- From the Tools menu, choose Options, and then click the Directories tab.
- 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
- Include files: C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Include
- Ensure that the hard-coded server name, user name, and password are correct.
- Compile the program.
- Open a Command Prompt window, and then change the current directory to C:\Program Files\Microsoft SQL Server\80\Tools\Devtools\Samples\DBLib\Sqltestc.
- 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 |