Here are the steps that I take:
ConnectionString = new char[strlen("DRIVER={SQL Server};SERVER=<SERVER>;UID=sa;PWD=;DATABASE=<DATABASE>;"

];
strcpy (ConnectionString, "DRIVER={SQL Server};SERVER=CORE11;UID=sa;PWD=;DATABASE=pubs;"

;
SQLAllocHandle((SQLSMALLINT)SQL_HANDLE_ENV, (SQLHANDLE)SQL_NULL_HANDLE, &(SQLHANDLE)henvl);
SQLError(henvl, NULL, NULL, state, nativeerror, errormsg, errormsgmax, pcberrormsg);
SQLSetEnvAttr((SQLHENV)henvl, (SQLINTEGER)SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, (SQLINTEGER)NULL);
SQLError(henvl, NULL, NULL, state, nativeerror, errormsg, errormsgmax, pcberrormsg);
SQLAllocHandle((SQLSMALLINT)SQL_HANDLE_DBC, (SQLHANDLE)henvl, &(SQLHANDLE)hdbc);
SQLError(henvl, hdbc, NULL, state, nativeerror, errormsg, errormsgmax, pcberrormsg);
SQLSetConnectAttr((SQLHDBC)hdbc, (SQLINTEGER)SQL_ATTR_ODBC_CURSORS, (SQLPOINTER)SQL_CUR_USE_DRIVER, (SQLINTEGER)0);
SQLError(henvl, hdbc, NULL, state, nativeerror, errormsg, errormsgmax, pcberrormsg);
SQLDriverConnect((SQLHDBC)hdbc, (SQLHWND)NULL, (SQLCHAR*)ConnectionString, (SQLSMALLINT)SQL_NTS, (SQLCHAR*)NULL, (SQLSMALLINT)NULL, (SQLSMALLINT*)NULL, (SQLSMALLINT)SQL_DRIVER_NOPROMPT);
SQLError(henvl, hdbc, NULL, state, nativeerror, errormsg, errormsgmax, pcberrormsg);<-- This is where I get the warning
SQLAllocHandle((SQLSMALLINT)SQL_HANDLE_STMT, (SQLHANDLE)hdbc, &(SQLHANDLE)hstmt);
SQLError(henvl, hdbc, hstmt, state, nativeerror, errormsg, errormsgmax, pcberrormsg);
SQLSetStmtAttr((SQLHSTMT)hstmt, (SQLINTEGER)SQL_CURSOR_TYPE, (SQLPOINTER)SQL_CURSOR_STATIC, (SQLINTEGER)0);
SQLError(henvl, hdbc, hstmt, state, nativeerror, errormsg, errormsgmax, pcberrormsg);
SQLPrepare((SQLHSTMT)hstmt, (SQLCHAR*)"SELECT * FROM Summary", (SQLINTEGER)strlen("SELECT * FROM Summary"

);
SQLError(henvl, hdbc, hstmt, state, nativeerror, errormsg, errormsgmax, pcberrormsg);
SQLExecute((SQLHSTMT)hstmt);
SQLError(henvl, hdbc, hstmt, state, nativeerror, errormsg, errormsgmax, pcberrormsg); <-- This is where I get the error.
SQLNumResultCols((SQLHSTMT)hstmt, &(SQLSMALLINT)ColNumber);
SQLError(henvl, hdbc, hstmt, state, nativeerror, errormsg, errormsgmax, pcberrormsg);
SQLGetData((SQLHSTMT)hstmt, (SQLUSMALLINT)1, (SQLSMALLINT)SQL_C_CHAR, (SQLPOINTER)Buffer, (SQLINTEGER)sizeof(Buffer), &(SQLINTEGER)BufLength);
SQLError(henvl, hdbc, hstmt, state, nativeerror, errormsg, errormsgmax, pcberrormsg);
SQLCloseCursor(hstmt);
SQLError(henvl, hdbc, hstmt, state, nativeerror, errormsg, errormsgmax, pcberrormsg);
Like I said...pubs will work fine..it's when I try a different database that it won't work. So frustrating!
Niky Williams
NTS Marketing Inc.