Click here to Skip to main content
15,881,742 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
must the vt datatype of a _variant_t be set before any database value is to it? I noticd in the msdn examples that I saw that the vt data type was set before use e.g. to VT_INTEGER.Is that the rule.I really don't need that.I hope that is not the rule.Thanks for your response.
Posted
Updated 20-Feb-14 1:34am
v2
Comments
Gbenbam 20-Feb-14 7:40am    
The sulution below may no longer be valid in the light of recent changes I made to this question.I hope to contact the provider of the solution to find oug it is still valid.If you have other solutions please proffer them.Thanks.

1 solution

_variant_t has overloaded constructors and overloaded = operators that will automatically set the vt member to the correct value.
So you never need to set it explicitly unless you want to override the default behavior.
 
Share this answer
 
Comments
Gbenbam 11-Feb-14 2:23am    
Thanks so much.You have more than made my day.
Gbenbam 20-Feb-14 7:48am    
Good day.I visited this page in order to put this solution to use and I suddenly realised that the question was not well framed enough to reflect mg quest.Kindly revisit the updated question and let me know if your solution is still valid or not?
Gbenbam 20-Feb-14 12:11pm    
I have personally and physically confirmed the validity of this solution to the updated version of the question.This solution remain very much still valid.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900