Click here to Skip to main content
15,916,280 members
Home / Discussions / Database
   

Database

 
AnswerRe: how i can automatically create an new Excel file once a new day using the C#? Pin
Richard MacCutchan18-Dec-11 23:42
mveRichard MacCutchan18-Dec-11 23:42 
Questiony this query answer wrong ? Pin
williamroma16-Dec-11 7:40
williamroma16-Dec-11 7:40 
AnswerRe: y this query answer wrong ? Pin
AmitGajjar17-Dec-11 7:53
professionalAmitGajjar17-Dec-11 7:53 
AnswerRe: y this query answer wrong ? Pin
coded00718-Dec-11 0:16
professionalcoded00718-Dec-11 0:16 
QuestionCRecorset fails to retrive fields when there is only one record in recordset. Pin
Vaclav_15-Dec-11 9:51
Vaclav_15-Dec-11 9:51 
AnswerRe: CRecorset fails to retrive fields when there is only one record in recordset. Pin
SilimSayo16-Dec-11 0:01
SilimSayo16-Dec-11 0:01 
AnswerRe: CRecorset fails to retrive fields when there is only one record in recordset. Pin
bsdtux19-Dec-11 5:39
bsdtux19-Dec-11 5:39 
GeneralRe: CRecorset fails to retrive fields when there is only one record in recordset. Pin
Vaclav_19-Dec-11 7:11
Vaclav_19-Dec-11 7:11 
I am sorry, I moved the question to MFC as suggested and did not even attempted to delete it here.
I think it cannot be deleted once discussion starts.
Yes, the field index is properly advanced and it works just fine with more than one record in the recordset - initially.
The key is that I get the first field OK, than it fails on next one.
I know the field is there because it retrives the record just fine when different SQL returns more records in recordset.

Here is the code snippet, I have removed my // comments for clarity, but it is pretty normal text retrieval loop.


pRecordset->AddNew(); fix , does not really adds anything
pRecordset->MoveFirst(); should not need this on initial Open recordset

short nFields = pRecordset->GetODBCFieldCount( );

while( !pRecordset->IsEOF( ) )
{
buffer = strText.GetBuffer(256);
// set item text
for( short index = 0; index < nFields; index++ )
{
pRecordset->GetFieldValue( index, strText );
buffer = strText.GetBuffer(256);
pList->SetItemText(iItem,index,buffer); this is where it fails
TRACE("\n item %i field %i buffer %s ",iItem , index , buffer );
}
pRecordset->MoveNext( );
iItem++;
}

I would like to get you opinions on this if you have time to work on it.
If so please switch to MFC forum.
Thanks
Vaclav
QuestionStored procedures with booleans leading to different data types. Pin
D Hoffman14-Dec-11 11:33
D Hoffman14-Dec-11 11:33 
AnswerRe: Stored procedures with booleans leading to different data types. Pin
SilimSayo14-Dec-11 12:58
SilimSayo14-Dec-11 12:58 
AnswerRe: Stored procedures with booleans leading to different data types. Pin
coded00715-Dec-11 2:50
professionalcoded00715-Dec-11 2:50 
AnswerRe: Stored procedures with booleans leading to different data types. Pin
Eddy Vluggen18-Dec-11 2:28
professionalEddy Vluggen18-Dec-11 2:28 
GeneralRe: Stored procedures with booleans leading to different data types. Pin
D Hoffman17-Jan-12 1:35
D Hoffman17-Jan-12 1:35 
QuestionConverting from Access to MSDE 2000 Pin
Member 801739614-Dec-11 4:47
Member 801739614-Dec-11 4:47 
AnswerRe: Converting from Access to MSDE 2000 Pin
Corporal Agarn14-Dec-11 9:17
professionalCorporal Agarn14-Dec-11 9:17 
QuestionEquivalent in MS Sql Pin
Hum Dum13-Dec-11 22:51
Hum Dum13-Dec-11 22:51 
AnswerRe: Equivalent in MS Sql Pin
Geoff Williams14-Dec-11 0:17
Geoff Williams14-Dec-11 0:17 
AnswerRe: Equivalent in MS Sql Pin
Shameel14-Dec-11 2:28
professionalShameel14-Dec-11 2:28 
GeneralRe: Equivalent in MS Sql Pin
SilimSayo14-Dec-11 2:51
SilimSayo14-Dec-11 2:51 
GeneralRe: Equivalent in MS Sql Pin
jschell14-Dec-11 9:26
jschell14-Dec-11 9:26 
GeneralRe: Equivalent in MS Sql Pin
Shameel15-Dec-11 7:27
professionalShameel15-Dec-11 7:27 
GeneralRe: Equivalent in MS Sql Pin
SilimSayo15-Dec-11 11:00
SilimSayo15-Dec-11 11:00 
GeneralRe: Equivalent in MS Sql Pin
jschell16-Dec-11 8:34
jschell16-Dec-11 8:34 
JokeRe: Equivalent in MS Sql Pin
SilimSayo16-Dec-11 14:31
SilimSayo16-Dec-11 14:31 
GeneralRe: Equivalent in MS Sql Pin
Shameel20-Dec-11 2:51
professionalShameel20-Dec-11 2:51 

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.