0

Hi am trying to ues ODBC connection in c using following code.But i was not able to find the header file for SQL.H and SQLEXT.H.It was even not found in the installed Include folder.Where to find the source for these two headers or is there any site available for downloading the header file.???

#include <stdio.h>
#include <sql.h>
 #include <sqlext.h>

Error is unable to find SQL.H

mloskot
  • 37,086
  • 11
  • 109
  • 136
Dah Sra
  • 4,107
  • 3
  • 30
  • 69

2 Answers2

2

sql.h and sqlext.h is part of Windows SDK. Windows SDK is installed after installation of Visual Studio or it's possible to download Windows SDK separately - SDK is free. For example, I have these files here - it depends on SDK version:

"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include\sqlext.h" 

Also check whether your C++ project settings has correct reference to Win SDK

enter image description here

Vlad
  • 1,977
  • 19
  • 44
  • In my case, the folder was `C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include`, but this got me looking in the right place. Thanks. – rstackhouse Jan 06 '17 at 20:05
0

If you have Windows SDK installed under Windows 8.1 or 10, then take a look under

"C:\Program Files (x86)\Windows Kits\10\Include\..."

or

"C:\Program Files (x86)\Windows Kits\8.1\Include\..."

include the following:

#include <Windows.h>
#include <sql.h>
#include <sqlext.h>
#include <sqltypes.h>
Uwe Köhler
  • 123
  • 1
  • 7