Skip to main content
gamedev.net
🔒 Locked

[web] Problem with odbc

Started by Florian22222 Nov 19, 2011 at 10:01 PM 0 replies 650+ views
Original Post
Florian22222
Florian22222
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



#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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.