Using ODBC to connect to SQL SERVER 2008

前端 未结 3 1455
一向
一向 2020-12-16 06:26

I\'m on a W32 machine trying to get a connection with a DB. For that purpose, I tried starting testing an example program:

#include 
#include         


        
相关标签:
3条回答
  • 2020-12-16 06:49

    ordering header files does not matter. Just ensure that your project contains in its properties the following include directory:

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

    where are found (a priori):

    windows.h
    sqlext.h
    sqltypes.h
    sql.h
    

    This suffices in making your commands recognized and compile without any problem.

    0 讨论(0)
  • 2020-12-16 06:49

    just change include declarations like this:

    #include <iostream>
    #include <windows.h>
    #include <sql.h>
    #include <sqltypes.h>
    #include <sqlext.h>
    
    0 讨论(0)
  • 2020-12-16 06:57

    I have found with stdafx.h header that the include order should be instead:

    #include <iostream>
    #include <windows.h>
    #include <sqlext.h>
    #include <sqltypes.h>
    #include <sql.h>
    
    0 讨论(0)
提交回复
热议问题