Possible BUG in CDaoRecordset::GetFieldValue() 
Author Message
 Possible BUG in CDaoRecordset::GetFieldValue()


I have come across the following problem which I think might be a bug in
the way MFC handles GetFieldValue. From the online documentation of
CDaoRecordset::GetFieldValue() it states "Note???It is more efficient to
call one of the versions of this member function that takes a COleVariant
object reference as a parameter, rather than calling a version that returns
a COleVariant object."

With this in mind I changed some of my code from:
pRecordset->GetFieldValue("Name", varname);

where varname is defined as a variant.

The function seems to work except if you make multiple calls to
GetFieldValue and one of values are NULL, the Variant member does not
become null.

For Example:
pRecordset->GetFieldValue("FirstName", varname); //OK
pRecordset->GetFieldValue("MiddleInitial", varname);  //Start of Problem
pRecordset->GetFieldValue("Country", varname); //Continuation of Problem

If MiddleInitial and Country are NULL and FirstName is not NULL ouput of
varname at the end of the code segment would give you the first name.
Clearly varname should contain no data. Am I missing something or is this a

Thanks in advance for your help.

Mitch Wittneben

Wed, 19 Jan 2000 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. CDaoRecordset::GetFieldValue returns {"?"}

2. cdaorecordset::GetFieldValue --> variant

3. cdaorecordset::GetFieldValue --> variant

4. ?CDaoRecordset::GetFieldValue doesn't put string in .bstrVal

5. CDaoRecordset GetFieldValue

6. CDaoRecordset.Update() is messing up GetFieldValue return

7. CDaoRecordset::GetFieldValue Error

8. CDaoRecordSet -- CDaoRecordSet -- CDaoRecordSet

9. Bug in CRecordset::GetFieldValue

10. CDaoRecordset and grid control - possible to bind?

11. CDaoRecordset: boolean and dynaset bug?

12. DFX and CDaoRecordset.Open() bug?


Powered by phpBB® Forum Software