Hi
i am using the following code for my development work
[code=c]
/* Connect to data source */
retcode = SQLConnect(hdbc , (SQLCHAR*) "mvr", SQL_NTS,
(SQLCHAR*) "venk", SQL_NTS,
(SQLCHAR*) "ram", SQL_NTS);
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WIT H_INFO){
/* Allocate statement handle */
retcode = SQLAllocHandle( SQL_HANDLE_STMT , hdbc, &hstmt);
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WIT H_INFO) {
/* Process data */
unsigned char query1[256];
sprintf((char*) query1,
"SELECT [col1], [col2], FROM MY_DATA WHERE
But above code is unable to retrive the data from DB.
Can you please give me any suggestions.
where as same query if i run in sql analyzer the values are coming correctly.
Thanks in advance
Venkat
i am using the following code for my development work
[code=c]
/* Connect to data source */
retcode = SQLConnect(hdbc , (SQLCHAR*) "mvr", SQL_NTS,
(SQLCHAR*) "venk", SQL_NTS,
(SQLCHAR*) "ram", SQL_NTS);
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WIT H_INFO){
/* Allocate statement handle */
retcode = SQLAllocHandle( SQL_HANDLE_STMT , hdbc, &hstmt);
if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WIT H_INFO) {
/* Process data */
unsigned char query1[256];
sprintf((char*) query1,
"SELECT [col1], [col2], FROM MY_DATA WHERE
Code:
= \'%s\' ",
pszCode );
retcode = SQLExecDirect( hstmt, (SQLCHAR *)query1, SQL_NTS);
//////////////////////////////
Can you please give me any suggestions.
where as same query if i run in sql analyzer the values are coming correctly.
Thanks in advance
Venkat
Comment