Original Post
I want to connect to a db via c++
this is my current code and i have it from http://cpp.canbal.com/index.php?/C-Plus-Plus/odbc-connection-134.html
i dont know how to handle and i just cant find any useful information about this. i hope you can help me.
this is my current code and i have it from http://cpp.canbal.com/index.php?/C-Plus-Plus/odbc-connection-134.html
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <sql.h>
#include <sqltypes.h>
#include <sqlext.h>
int _tmain(int argv,_TCHAR* argc)
{
SQLHANDLE hdlEnv, hdlConn, hdlStmt, hdlDbc;
if(SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &hdlEnv)==SQL_SUCCESS) printf("ok");
SQLSetEnvAttr(hdlEnv,SQL_ATTR_ODBC_VERSION,(void*)SQL_OV_ODBC30); //here my compiler says that SQL_OV_ODBC30 is undeclared
system("pause");
}
i dont know how to handle and i just cant find any useful information about this. i hope you can help me.