Try this code which worked in my case.
#include <stdio.h>
#include <windows.h>
#include <sql.h>
#include <sqlext.h>
//#include <odbcss.h>
#include ".\\sqlncli.h"
SQLHENV henv = SQL_NULL_HENV;
HDBC hdbc1 = SQL_NULL_HDBC;
typedef RETCODE (CALLBACK* SQL_API bcp_initA123 )(HDBC, LPCSTR, LPCSTR, LPCSTR, INT);
typedef...