Visual Studio 2010 C++ afxdb.h C2065: 'SQL_SUCCESS' : undeclared identifier

jspies
jspies used Ask the Experts™
on
Why do I get the following compile errors in Visual Studio 2010 although it was not an issue on 2008:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxdb.h(184): error C2065: 'SQL_SUCCESS' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxdb.h(424): error C2065: 'SQL_VARCHAR' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxdb.h(427): error C2065: 'SQL_VARCHAR' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxdb.h(430): error C2065: 'SQL_VARCHAR' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxdb.h(432): error C2065: 'SQL_VARCHAR' : undeclared identifier

Regards
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2012
Commented:
Try to add

#include <sql.h>

before incliding 'afxdb.h'.

Author

Commented:
Thanks for the feedback - I realised it is picking up a different sql.h thatn in my 2008 compiler which has got different SQL definitions.  I need an extra include folder to pull in the same sql.h as in 2008.

Author

Commented:
I did not get the exact anwer needed although it guided me in the right direction

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial