Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

simple ODBC Connection in C++ (Dev C++ in a windows environment)

Posted on 2008-06-26
6
Medium Priority
?
8,633 Views
Last Modified: 2013-12-14
I'm trying to write a simple C++ program that will live on a variety of Windows platforms (98 through XP).

The program reads a simple configuration file, and depending on one of those variables, it obtains data either from a file or a database and sftp's it to my company's server for processing.

Everything works fine except the connection to the databases.  
I'm writing the program in Dev C++ in a Windows environment, and I'm trying to connect to a Sybase DB that has an ODBC connection already set up.

I've scoured the internet and not come up with a viable example to work off of.

Can someone please give me a little guidance on using hy IDE to access a simple ODBC connection?
...
#include <sql.h>
#include <sqltypes.h>
#include <sqlext.h>
...
 
if (vendor == "1") { //** Micros - v.3.2 and older
       SQLHandle hdlEnv, hdlConn, hdlStmt, hdlDbc
       char* stmt = "SELECT * from NutHead"; //SQL statement? NutHead is the Table name
 
       //for example
       char *dsnName = COLLECTOR ? name of your program or what ever&..
       char* userID = "eXceed";
       char* passwd = "hole";
       char* retVal[256];
       unsigned int cbData;
 
       SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &hdlEnv);
       SQLSetEnvAttr(hdlEnv,SQL_ATTR_ODBC_VERSION,(void*)SQL_OV_ODBC30);
       SQLAllocHandle(SQL_HANDLE_DBC, hdlEnv, &hdlConn);
       SQLConnect(hdlConn, SQLCHAR*)dsnName,SQL_NTS,(SQLCHAR*)userID,SQL_NTS, (SQLCHAR*)passwd, SQL_NTS);
       SQLAllocHandle(SQL_HANDLE_STMT, hdlDbc, &hdlStmt);
       SQLExecDirect(hdlStmt, (SQLCHAR*)stmt, SQL_NTS);
       
       //Initialize the database connection
 
       while(SQLFetch(hdlStmt) == SQL_SUCCEEDED) {
          SQLGetData(hdlStmt,0,DT_STRING,retVal,256,&cbData);
          std::cout << retVal << std::endl;
       }
       
       SQLFreeHandle(SQL_HANDLE_STMT, hdlStmt);
       SQLFreeHandle(SQL_HANDLE_DBC, hdlConn);
       SQLFreeHandle(SQL_HANDLE_ENV, hdlEnv);  //End the connection
    }

Open in new window

0
Comment
Question by:jamied66
  • 4
6 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 2000 total points
ID: 21882548
I've attached a working example.  That ought to get you started.  Just use a loop on the SQLGetData line, as you did in your own code.

Incidently, it is rare to need to program at this level.  Nearly all systems provide class objects to wrap these low-level functions and simplify it considerably.

-- Dan
#include <sql.h>
#include <sqltypes.h>
#include <sqlext.h>
#pragma comment(lib, "Odbc32.lib" )
 
void CD48Dlg::OnButton3() 
{
	char* szStmt= "SELECT MyClm FROM MyTbl"; // SQL statement
 
	UCHAR* szDSN = (UCHAR*)"MyDSN";        // DSN
	UCHAR* szUID = (UCHAR*)"MyUser";       // db User ID
	UCHAR* szPWD = (UCHAR*)"MyPassword";   // Db User's password
 
	UCHAR  szRetVal[256];
	long  cbData;
 
	HENV   hEnv = NULL; // Env Handle from SQLAllocEnv()
	HDBC   hDBC = NULL; // Connection handle
	HSTMT  hStmt= NULL; // Statment handle 
 
	int nRet;
	nRet= SQLAllocEnv(    &hEnv );
	nRet= SQLAllocConnect( hEnv, &hDBC );
	nRet= SQLConnect( hDBC, szDSN, SQL_NTS, szUID, SQL_NTS, szPWD, SQL_NTS);
 
	nRet= SQLAllocHandle( SQL_HANDLE_STMT, hDBC, &hStmt );
	nRet= SQLExecDirect(  hStmt, (SQLCHAR*)szStmt, SQL_NTS);
 
	nRet= SQLFetch( hStmt );
	nRet= SQLGetData(hStmt,1,SQL_C_CHAR, szRetVal, 256, &cbData );   // get first data column
	// std::cout << szRetVal << std::endl;
 
	SQLFreeHandle( SQL_HANDLE_STMT, hStmt );
	SQLFreeHandle( SQL_HANDLE_DBC, hDBC   );
	SQLFreeHandle( SQL_HANDLE_ENV, hEnv   );  
}

Open in new window

0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 21889902
>>>> Incidently, it is rare to need to program at this level.  
Hmmm, that isn't quite true. For instance, if you need to make portable database programming, there is hardly an alternative to native ODBC. Sometimes these class wrappers connect to one DBMS type only. Or they implement only the smallest common part of the supported databases. And though there are many ODBC class wrappers, I know none, where you could adopt the above sample with lesser code...  

Regards, Alex
0
 

Author Comment

by:jamied66
ID: 21963009
I'm sorry this took so long to respond to.  I was sidetracked on another project for a little while.

I copied your example, ver batim, into my install of Dev C++, just to see if it would compile.

Here is what I compliled (after linking lib/libodbc32.a from the Dev C++ lib folder in the Project Options panel)

I've also included the Compile Log (324 errors).

C++ is far from my natural environment (a PHP/Perl guy).  But if I can just get a testable connection to this database I'll be home free.

All help is appreciated, again.


#include <cstdlib>
#include <iostream>
#include <sql.h>
#include <sqltypes.h>
#include <sqlext.h>
#pragma comment(lib, "Odbc32.lib" )
 
void CD48Dlg::OnButton3() 
{
        char* szStmt= "SELECT MyClm FROM MyTbl"; // SQL statement
 
        UCHAR* szDSN = (UCHAR*)"MyDSN";        // DSN
        UCHAR* szUID = (UCHAR*)"MyUser";       // db User ID
        UCHAR* szPWD = (UCHAR*)"MyPassword";   // Db User's password
 
        UCHAR  szRetVal[256];
        long  cbData;
 
        HENV   hEnv = NULL; // Env Handle from SQLAllocEnv()
        HDBC   hDBC = NULL; // Connection handle
        HSTMT  hStmt= NULL; // Statment handle 
 
        int nRet;
        nRet= SQLAllocEnv(    &hEnv );
        nRet= SQLAllocConnect( hEnv, &hDBC );
        nRet= SQLConnect( hDBC, szDSN, SQL_NTS, szUID, SQL_NTS, szPWD, SQL_NTS);
 
        nRet= SQLAllocHandle( SQL_HANDLE_STMT, hDBC, &hStmt );
        nRet= SQLExecDirect(  hStmt, (SQLCHAR*)szStmt, SQL_NTS);
 
        nRet= SQLFetch( hStmt );
        nRet= SQLGetData(hStmt,1,SQL_C_CHAR, szRetVal, 256, &cbData );   // get first data column
        // std::cout << szRetVal << std::endl;
 
        SQLFreeHandle( SQL_HANDLE_STMT, hStmt );
        SQLFreeHandle( SQL_HANDLE_DBC, hDBC   );
        SQLFreeHandle( SQL_HANDLE_ENV, hEnv   );  
}
 
 
 
 
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing  make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe -D__DEBUG__ -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"    -g3
 
In file included from C:/Dev-Cpp/include/sql.h:13,
                 from main.cpp:3:
C:/Dev-Cpp/include/sqltypes.h:17: error: `ULONG' does not name a type
C:/Dev-Cpp/include/sqltypes.h:18: error: `USHORT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:24: error: `PVOID' does not name a type
C:/Dev-Cpp/include/sqltypes.h:25: error: `PVOID' does not name a type
C:/Dev-Cpp/include/sqltypes.h:26: error: `PVOID' does not name a type
C:/Dev-Cpp/include/sqltypes.h:27: error: `PVOID' does not name a type
C:/Dev-Cpp/include/sqltypes.h:29: error: `UCHAR' does not name a type
C:/Dev-Cpp/include/sqltypes.h:34: error: `UDWORD' does not name a type
C:/Dev-Cpp/include/sqltypes.h:36: error: `UWORD' does not name a type
C:/Dev-Cpp/include/sqltypes.h:37: error: `PVOID' does not name a type
C:/Dev-Cpp/include/sqltypes.h:50: error: `HWND' does not name a type
C:/Dev-Cpp/include/sqltypes.h:51: error: `ULONG' does not name a type
C:/Dev-Cpp/include/sqltypes.h:71: error: `SQLCHAR' does not name a type
C:/Dev-Cpp/include/sqltypes.h:90: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:91: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:94: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:95: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:96: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:100: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:101: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:102: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:103: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:104: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:105: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:118: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:119: error: `SQLUINTEGER' does not name a type
 
C:/Dev-Cpp/include/sqltypes.h:122: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:123: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:124: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:125: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:126: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:138: error: `SQLCHAR' does not name a type
 
C:/Dev-Cpp/include/sqltypes.h:140: error: `SQLCHAR' does not name a type
C:/Dev-Cpp/include/sqltypes.h:141: error: `SQLCHAR' does not name a type
C:/Dev-Cpp/include/sqltypes.h:154: error: `DWORD' does not name a type
C:/Dev-Cpp/include/sqltypes.h:155: error: `WORD' does not name a type
C:/Dev-Cpp/include/sqltypes.h:156: error: `WORD' does not name a type
C:/Dev-Cpp/include/sqltypes.h:157: error: `BYTE' does not name a type
In file included from main.cpp:3:
C:/Dev-Cpp/include/sql.h:346: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:346: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:348: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:348: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:348: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:349: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:349: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:349: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sql.h:351: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:351: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:352: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:357: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:358: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:360: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:362: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:363: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:364: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:364: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sql.h:364: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:365: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:365: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:365: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:365: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:366: error: `SQLUSMALLINT' has not been declared
 
C:/Dev-Cpp/include/sql.h:366: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:367: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:367: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:368: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:368: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:369: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:369: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:370: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:370: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:372: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:373: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:374: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:374: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sql.h:375: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:375: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sql.h:376: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:376: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:376: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:376: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:376: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:376: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:377: error: `SQLCHAR' has not been declared
 
C:/Dev-Cpp/include/sql.h:377: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:377: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:377: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:377: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:378: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:378: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:378: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:378: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:379: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:379: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:379: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:382: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:382: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sql.h:382: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:384: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:384: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:384: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:384: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:389: error: `SQLPOINTER' has not been declared
 
C:/Dev-Cpp/include/sql.h:390: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:391: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:393: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:394: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:394: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:395: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:396: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:397: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:398: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:400: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:401: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:402: error: `SQLPOINTER' has not been declared
In file included from main.cpp:5:
C:/Dev-Cpp/include/sqlext.h:1184: error: `SQLHWND' has not been declared
 
C:/Dev-Cpp/include/sqlext.h:1184: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1184: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1184: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1185: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1185: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1186: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1186: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1186: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1186: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1187: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1187: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1187: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlext.h:1188: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1188: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlext.h:1189: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1189: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlext.h:1189: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1190: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1190: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1190: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1190: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1190: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1190: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1192: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1192: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1194: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlext.h:1194: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlext.h:1195: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1195: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1195: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1196: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1196: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1196: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1196: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1197: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1197: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1197: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1198: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1198: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1198: error: `SQLUSMALLINT' has not been declared
 
C:/Dev-Cpp/include/sqlext.h:1199: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1199: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1199: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1200: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1200: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1200: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1201: error: `SQLUSMALLINT' has not been declared
 
C:/Dev-Cpp/include/sqlext.h:1201: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlext.h:1201: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlext.h:1202: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1202: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1203: error: expected constructor, destructor, or type conversion before "ODBCGetTryWaitValue"
C:/Dev-Cpp/include/sqlext.h:1203: error: expected `,' or `;' before "ODBCGetTryWaitValue"
 
C:/Dev-Cpp/include/sqlext.h:1204: error: expected constructor, destructor, or type conversion before "ODBCSetTryWaitValue"
C:/Dev-Cpp/include/sqlext.h:1204: error: expected `,' or `;' before "ODBCSetTryWaitValue"
C:/Dev-Cpp/include/sqlext.h:1205: error: `LPWSTR' was not declared in this scope
C:/Dev-Cpp/include/sqlext.h:1205: error: `LPWSTR' was not declared in this scope
C:/Dev-Cpp/include/sqlext.h:1205: error: `DWORD' was not declared in this scope
C:/Dev-Cpp/include/sqlext.h:1205: error: initializer expression list treated as compound expression
C:/Dev-Cpp/include/sqlext.h:1207: error: expected constructor, destructor, or type conversion before "TraceReturn"
C:/Dev-Cpp/include/sqlext.h:1207: error: expected `,' or `;' before "TraceReturn"
C:/Dev-Cpp/include/sqlext.h:1208: error: expected constructor, destructor, or type conversion before "TraceVersion"
C:/Dev-Cpp/include/sqlext.h:1208: error: expected `,' or `;' before "TraceVersion"
In file included from C:/Dev-Cpp/include/sqlext.h:1214,
                 from main.cpp:5:
C:/Dev-Cpp/include/sqlucode.h:22: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:22: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:24: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:24: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:25: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:25: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:25: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:25: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:26: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:26: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:26: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:27: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:27: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:27: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:28: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:28: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:28: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:28: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:30: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:30: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:30: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:30: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:32: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:32: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:32: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:34: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:34: error: `SQLCHAR' has not been declared
 
C:/Dev-Cpp/include/sqlucode.h:34: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:35: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:36: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:36: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:36: error: `SQLUINTEGER' has not been declared
 
C:/Dev-Cpp/include/sqlucode.h:37: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:37: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:38: error: `SQLHWND' has not been declared
C:/Dev-Cpp/include/sqlucode.h:38: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:38: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:38: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:39: error: `SQLHWND' has not been declared
C:/Dev-Cpp/include/sqlucode.h:39: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:40: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:40: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:40: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:41: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:42: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:42: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:44: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:46: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:46: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:46: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:46: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:46: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:46: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:48: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:49: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:50: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:50: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:51: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:51: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:52: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:54: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:54: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:55: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:55: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:58: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:58: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:60: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:62: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:62: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:62: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:64: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:64: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:64: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:64: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:66: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:66: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:66: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:68: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:69: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:70: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:70: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:71: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:71: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:72: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:74: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:74: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:74: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:74: error: `SQLCHAR' has not been declared
 
C:/Dev-Cpp/include/sqlucode.h:74: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:74: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:75: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:75: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:75: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:76: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:76: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:76: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:76: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:76: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:77: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:77: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:78: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:78: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:78: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:80: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:80: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:80: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:80: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:83: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:84: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:85: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:86: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:87: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:89: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:90: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:91: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:91: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:93: error: `SQLPOINTER' has not been declared
 
C:/Dev-Cpp/include/sqlucode.h:94: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:95: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:96: error: `SQLPOINTER' has not been declared
main.cpp:8: error: `CD48Dlg' has not been declared
main.cpp: In function `void OnButton3()':
main.cpp:12: error: `UCHAR' undeclared (first use this function)
main.cpp:12: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:12: error: `szDSN' undeclared (first use this function)
main.cpp:12: error: expected primary-expression before ')' token
main.cpp:12: error: expected `;' before string constant
main.cpp:13: error: `szUID' undeclared (first use this function)
 
main.cpp:13: error: expected primary-expression before ')' token
main.cpp:13: error: expected `;' before string constant
main.cpp:14: error: `szPWD' undeclared (first use this function)
main.cpp:14: error: expected primary-expression before ')' token
main.cpp:14: error: expected `;' before string constant
main.cpp:16: error: expected `;' before "szRetVal"
main.cpp:19: error: `HENV' undeclared (first use this function)
main.cpp:19: error: expected `;' before "hEnv"
main.cpp:20: error: `HDBC' undeclared (first use this function)
main.cpp:20: error: expected `;' before "hDBC"
main.cpp:21: error: `HSTMT' undeclared (first use this function)
 
main.cpp:21: error: expected `;' before "hStmt"
main.cpp:24: error: `hEnv' undeclared (first use this function)
main.cpp:25: error: `hDBC' undeclared (first use this function)
main.cpp:28: error: `hStmt' undeclared (first use this function)
main.cpp:29: error: `SQLCHAR' undeclared (first use this function)
main.cpp:29: error: expected primary-expression before ')' token
main.cpp:32: error: `szRetVal' undeclared (first use this function)
 
make.exe: *** [main.o] Error 1
 
Execution terminated

Open in new window

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jamied66
ID: 21963047
I'm using Dev C++ 4.9.9.2, by the way.  I'm steering clear of VC++ because this particular little application needs to run with no dependency on a runtime library or any other system environment that may have to be installed.

Thanks again.
0
 

Author Comment

by:jamied66
ID: 21963508
it looks like the issue stems back to sqltypes.h
using the following code, I get 299 compile errors, even after linking to every library that I can conceive of.  code and complie log off of Dev C++ follow:



#include <cstdlib>
#include <iostream>
#include <sql.h>
#include<sqltypes.h>
#include<sqlext.h>
#include<windows.h>
 
using namespace std;
 
int main(int argc, char *argv[])
{
    system("PAUSE");
    return EXIT_SUCCESS;
}
 
 
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing  make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe -D__DEBUG__ -c sql.cpp -o sql.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"    -g3
 
In file included from C:/Dev-Cpp/include/sql.h:13,
                 from sql.cpp:3:
C:/Dev-Cpp/include/sqltypes.h:17: error: `ULONG' does not name a type
C:/Dev-Cpp/include/sqltypes.h:18: error: `USHORT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:24: error: `PVOID' does not name a type
C:/Dev-Cpp/include/sqltypes.h:25: error: `PVOID' does not name a type
C:/Dev-Cpp/include/sqltypes.h:26: error: `PVOID' does not name a type
C:/Dev-Cpp/include/sqltypes.h:27: error: `PVOID' does not name a type
C:/Dev-Cpp/include/sqltypes.h:29: error: `UCHAR' does not name a type
 
C:/Dev-Cpp/include/sqltypes.h:34: error: `UDWORD' does not name a type
C:/Dev-Cpp/include/sqltypes.h:36: error: `UWORD' does not name a type
C:/Dev-Cpp/include/sqltypes.h:37: error: `PVOID' does not name a type
C:/Dev-Cpp/include/sqltypes.h:50: error: `HWND' does not name a type
C:/Dev-Cpp/include/sqltypes.h:51: error: `ULONG' does not name a type
C:/Dev-Cpp/include/sqltypes.h:71: error: `SQLCHAR' does not name a type
C:/Dev-Cpp/include/sqltypes.h:90: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:91: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:94: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:95: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:96: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:100: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:101: error: `SQLUSMALLINT' does not name a type
 
C:/Dev-Cpp/include/sqltypes.h:102: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:103: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:104: error: `SQLUSMALLINT' does not name a type
C:/Dev-Cpp/include/sqltypes.h:105: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:118: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:119: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:122: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:123: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:124: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:125: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:126: error: `SQLUINTEGER' does not name a type
C:/Dev-Cpp/include/sqltypes.h:138: error: `SQLCHAR' does not name a type
C:/Dev-Cpp/include/sqltypes.h:140: error: `SQLCHAR' does not name a type
C:/Dev-Cpp/include/sqltypes.h:141: error: `SQLCHAR' does not name a type
C:/Dev-Cpp/include/sqltypes.h:154: error: `DWORD' does not name a type
C:/Dev-Cpp/include/sqltypes.h:155: error: `WORD' does not name a type
C:/Dev-Cpp/include/sqltypes.h:156: error: `WORD' does not name a type
C:/Dev-Cpp/include/sqltypes.h:157: error: `BYTE' does not name a type
In file included from sql.cpp:3:
C:/Dev-Cpp/include/sql.h:346: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:346: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:348: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:348: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:348: error: `SQLCHAR' has not been declared
 
C:/Dev-Cpp/include/sql.h:349: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:349: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:349: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sql.h:351: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:351: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:352: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:357: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:358: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:360: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:362: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:363: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:364: error: `SQLUSMALLINT' has not been declared
 
C:/Dev-Cpp/include/sql.h:364: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sql.h:364: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:365: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:365: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:365: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:365: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:366: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:366: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:367: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:367: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:368: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:368: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:369: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:369: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:370: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:370: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:372: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:373: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:374: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:374: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sql.h:375: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:375: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sql.h:376: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:376: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:376: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:376: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:376: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:376: error: `SQLUSMALLINT' has not been declared
 
C:/Dev-Cpp/include/sql.h:377: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:377: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:377: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:377: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:377: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:378: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:378: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:378: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:378: error: `SQLCHAR' has not been declared
 
C:/Dev-Cpp/include/sql.h:379: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:379: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:379: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:382: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:382: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sql.h:382: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:384: error: `SQLUSMALLINT' has not been declared
 
C:/Dev-Cpp/include/sql.h:384: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sql.h:384: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:384: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:389: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:390: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:391: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:393: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:394: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:394: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sql.h:395: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:396: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:397: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:398: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:400: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sql.h:401: error: `SQLPOINTER' has not been declared
 
C:/Dev-Cpp/include/sql.h:402: error: `SQLPOINTER' has not been declared
In file included from sql.cpp:5:
C:/Dev-Cpp/include/sqlext.h:1184: error: `SQLHWND' has not been declared
C:/Dev-Cpp/include/sqlext.h:1184: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1184: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1184: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1185: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1185: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1186: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1186: error: `SQLCHAR' has not been declared
 
C:/Dev-Cpp/include/sqlext.h:1186: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1186: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1187: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1187: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1187: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlext.h:1188: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1188: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlext.h:1189: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1189: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlext.h:1189: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1190: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1190: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1190: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1190: error: `SQLCHAR' has not been declared
 
C:/Dev-Cpp/include/sqlext.h:1190: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1190: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1192: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1192: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1194: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlext.h:1194: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlext.h:1195: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1195: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1195: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1196: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1196: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1196: error: `SQLCHAR' has not been declared
 
C:/Dev-Cpp/include/sqlext.h:1196: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1197: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1197: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1197: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1198: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1198: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1198: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1199: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1199: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1199: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1200: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1200: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1200: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlext.h:1201: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1201: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlext.h:1201: error: `SQLPOINTER' has not been declared
 
C:/Dev-Cpp/include/sqlext.h:1202: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1202: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlext.h:1203: error: expected constructor, destructor, or type conversion before "ODBCGetTryWaitValue"
C:/Dev-Cpp/include/sqlext.h:1203: error: expected `,' or `;' before "ODBCGetTryWaitValue"
C:/Dev-Cpp/include/sqlext.h:1204: error: expected constructor, destructor, or type conversion before "ODBCSetTryWaitValue"
C:/Dev-Cpp/include/sqlext.h:1204: error: expected `,' or `;' before "ODBCSetTryWaitValue"
C:/Dev-Cpp/include/sqlext.h:1205: error: `LPWSTR' was not declared in this scope
C:/Dev-Cpp/include/sqlext.h:1205: error: `LPWSTR' was not declared in this scope
 
C:/Dev-Cpp/include/sqlext.h:1205: error: `DWORD' was not declared in this scope
C:/Dev-Cpp/include/sqlext.h:1205: error: initializer expression list treated as compound expression
C:/Dev-Cpp/include/sqlext.h:1207: error: expected constructor, destructor, or type conversion before "TraceReturn"
C:/Dev-Cpp/include/sqlext.h:1207: error: expected `,' or `;' before "TraceReturn"
C:/Dev-Cpp/include/sqlext.h:1208: error: expected constructor, destructor, or type conversion before "TraceVersion"
C:/Dev-Cpp/include/sqlext.h:1208: error: expected `,' or `;' before "TraceVersion"
In file included from C:/Dev-Cpp/include/sqlext.h:1214,
                 from sql.cpp:5:
C:/Dev-Cpp/include/sqlucode.h:22: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:22: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:24: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:24: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:25: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:25: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:25: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:25: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:26: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:26: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:26: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:27: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:27: error: `SQLUSMALLINT' has not been declared
 
C:/Dev-Cpp/include/sqlucode.h:27: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:28: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:28: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:28: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:28: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:30: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:30: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:30: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:30: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:32: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:32: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:32: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:34: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:34: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:34: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:35: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:36: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:36: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:36: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:37: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:37: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:38: error: `SQLHWND' has not been declared
C:/Dev-Cpp/include/sqlucode.h:38: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:38: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:38: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:39: error: `SQLHWND' has not been declared
C:/Dev-Cpp/include/sqlucode.h:39: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:40: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:40: error: `SQLCHAR' has not been declared
 
C:/Dev-Cpp/include/sqlucode.h:40: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:41: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:42: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:42: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:44: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:46: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:46: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:46: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:46: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:46: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:46: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:48: error: `SQLPOINTER' has not been declared
 
C:/Dev-Cpp/include/sqlucode.h:49: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:50: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:50: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:51: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:51: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:52: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:54: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:54: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:55: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:55: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:58: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:58: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:60: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:62: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:62: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:62: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:64: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:64: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:64: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:64: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:66: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:66: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:66: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:68: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:69: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:70: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:70: error: `SQLUINTEGER' has not been declared
 
C:/Dev-Cpp/include/sqlucode.h:71: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:71: error: `SQLUINTEGER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:72: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:74: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:74: error: `SQLCHAR' has not been declared
 
C:/Dev-Cpp/include/sqlucode.h:74: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:74: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:74: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:74: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:75: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:75: error: `SQLUSMALLINT' has not been declared
 
C:/Dev-Cpp/include/sqlucode.h:75: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:76: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:76: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:76: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:76: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:76: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:77: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:77: error: `SQLUSMALLINT' has not been declared
C:/Dev-Cpp/include/sqlucode.h:78: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:78: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:78: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:80: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:80: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:80: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:80: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:83: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:84: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:85: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:86: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:87: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:89: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:90: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:91: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:91: error: `SQLCHAR' has not been declared
C:/Dev-Cpp/include/sqlucode.h:93: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:94: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:95: error: `SQLPOINTER' has not been declared
C:/Dev-Cpp/include/sqlucode.h:96: error: `SQLPOINTER' has not been declared
 
make.exe: *** [sql.o] Error 1
 
Execution terminated

Open in new window

0
 

Author Comment

by:jamied66
ID: 21963980
ah. the windows.h include needs to be called before the sql headers.
thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question