-
January 3rd, 2003, 07:31 AM
#1
GetFieldValue return the wrong value
Dear guru.
the code below.
COleVariant varValue;
m_pRecordSet->GetFieldValue("string field",varValue);
AfxMessageBox(V_BSTRT(&varValue)); //-->return right value
//but the line below return wrong value. for example my value is 5 but it return 1539825157
m_pRecordSet->GetFieldValue("int field",varValue);
int i = varValue.intVal;
char buffer[20];
itoa(i,buffer,10);
AfxMessageBox(buffer); //-->return wrong value
if anyone know how to solve this problem pleas help me.
Thank You.
-
January 3rd, 2003, 08:11 AM
#2
-
January 3rd, 2003, 08:26 AM
#3
Look carefully wat what varValue contains in the VT member. I think you will find it contains a string representation of your fields contents
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|