Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> odbc setstmtattr return SQL_ERROR

odbc setstmtattr return SQL_ERROR

From: david chan <davidchantf_at_HOTMAIL.COM>
Date: 14 Aug 2001 09:38:38 -0700
Message-ID: <5d09544f.0108140838.6d53f8cb@posting.google.com>


Hi,
 I try to do row-wise binding for retriving a block of data instead of just one row. I try to use the example from Microsoft MSDN lib, but can't do it.
 Here is what I did:

  1. create DB connection, success
  2. create statement sucess
    • SQLAllocHandle(SQL_HANDLE_STMT, myDbConnection, &myDbStatement);
    • SQLPrepare(myDbStatement,(unsigned char*)myStatement,nStatementLength);
  3. setStatementAttr failed
    • SQLSetStmtAttr(myDbStatement, SQL_ATTR_ROW_BIND_TYPE, (void*)sizeof(MYSTUCINFO), 0) // this one return SQL_ERROR
    • SQLGetDiagRec(SQL_HANDLE_STMT, myDbStatement,nRecordNumber,(unsigned char*)szSqlState, &lNativeError,(unsigned char*)szMessage, sizeof(szMessage),&nMessageLength); // can't getDiagRec it returns SQL_NO_DATA, nRecordNumber = 1, the szSqlState is empty, szMessage is empty also.

I am using Oracle 8.1.7 odbc driver and VC++ 6.0 in winnt 4.0 .

Any idea ?
Thanks.
David Received on Tue Aug 14 2001 - 11:38:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US