Click here to Skip to main content
15,903,856 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralThanks but... Pin
Braulio Diez22-Nov-99 21:20
sussBraulio Diez22-Nov-99 21:20 
GeneralRE: Thanks but... Pin
Henk Devos23-Nov-99 9:27
Henk Devos23-Nov-99 9:27 
GeneralRE: Basic OOP question... Pin
sandrine22-Nov-99 22:07
sandrine22-Nov-99 22:07 
GeneralRE: RE: Basic OOP question... Pin
Braulio Diez23-Nov-99 1:57
sussBraulio Diez23-Nov-99 1:57 
GeneralRE: RE: RE: Basic OOP question... Pin
Anonymous23-Nov-99 7:41
suss Anonymous23-Nov-99 7:41 
GeneralRe: Basic OOP question... Pin
Member 147421-Apr-00 11:01
Member 147421-Apr-00 11:01 
GeneralDebugging Control Panel Applets Pin
Farzad Bakhtiar9-Apr-00 21:56
sussFarzad Bakhtiar9-Apr-00 21:56 
GeneralGetFieldValue() throws an exception Pin
Stefan20-Nov-99 5:25
Stefan20-Nov-99 5:25 
I have a code like this

CString cSQL;
CDatabase db;
db.OpenEx( NULL, CDatabase::forceOdbcDialog );

CRecordset tbl( &db );

cSQL.Format( "SELECT * FROM tablename WHERE ID = %d", nID );
tbl.Open( CRecordset::forwardOnly, cSQL );

try {
tbl.GetFieldValue( "ID", cSQL );
tbl.GetFieldValue( "ID", cSQL );
}
catch( CException* e ) {
char szCause[255];
e->GetErrorMessage( szCause, 255 );
e->Delete();
}

The first GetFieldValue() call gets appropriate value into cSQL variable.
But on the second GetFieldValue() call I get CDBException and
the value of szCause is "" - empty string and m_nRetCode member of
CException object is 100.

What is wrong in this code?

Any help would be very helpful.

Thanks in advance.

Stefan


GeneralRE: GetFieldValue() throws an exception Pin
Member 40424-Nov-99 9:38
Member 40424-Nov-99 9:38 
GeneralRe: a step by step running Pin
goldmount19-Nov-04 3:25
goldmount19-Nov-04 3:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.