Skip to content

Instantly share code, notes, and snippets.

@sergioceron
Created August 12, 2012 18:14
Show Gist options
  • Save sergioceron/3333531 to your computer and use it in GitHub Desktop.
Save sergioceron/3333531 to your computer and use it in GitHub Desktop.
Perform query DSN Windows C++
int retcode = 0;
retcode = SQLAllocStmt (hDBC, &hStmt);
retcode = SQLPrepare (hStmt, (UCHAR *)sql, SQL_NTS);
retcode = SQLExecute (hStmt);
//SQLBindCol(hStmt, no+1, SQL_C_CHAR, szModel1, sizeof(szModel1), &cbModel1);
retcode = SQLFetch (hStmt);
if (retcode == SQL_ERROR)
{
// error handle
}
SQLFreeStmt (hStmt, SQL_DROP);
SQLDisconnect(hDBC);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment