Click here to Skip to main content
15,921,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: 5 damned fonts Pin
Nish Nishant4-Aug-02 15:24
sitebuilderNish Nishant4-Aug-02 15:24 
GeneralRe: 5 damned fonts Pin
Roman Nurik4-Aug-02 19:25
Roman Nurik4-Aug-02 19:25 
GeneralRe: 5 damned fonts Pin
Ravi Bhavnani4-Aug-02 14:50
professionalRavi Bhavnani4-Aug-02 14:50 
GeneralRe: 5 damned fonts Pin
Shog94-Aug-02 15:27
sitebuilderShog94-Aug-02 15:27 
GeneralRe: 5 damned fonts Pin
Nish Nishant4-Aug-02 15:58
sitebuilderNish Nishant4-Aug-02 15:58 
Generalextracting the value from a database(ADO) Pin
nss4-Aug-02 14:10
nss4-Aug-02 14:10 
GeneralRe: extracting the value from a database(ADO) Pin
Christian Graus4-Aug-02 14:20
protectorChristian Graus4-Aug-02 14:20 
GeneralRe: extracting the value from a database(ADO) Pin
RChin5-Aug-02 4:39
RChin5-Aug-02 4:39 
The .vt value of the returned variant will tell you what type the returned field is. This will indicate how you treat the _variant_t data type.
The various data type can be found in the documentation of the VARIANT data type.
Here is a simple extract of how I tend to use the returned variant value from a recordset:

CString str = _T("");
_variant_t vtFld;

vtFld = pRecordset->Fields->GetItem(lpczFieldName)->Value;
switch(vtFld.vt)
{
case VT_BSTR:
    str = vtFld.bstrVal;
    break;
case VT_I4:
    str = IntToStr(vtFld.iVal);
    break;
case VT_DATE:
    {
        COleDateTime dt(vtFld);
        szValue = dt.Format(_T("%Y-%m-%d %H:%M:%S"));
    }
    break;
case VT_EMPTY:
case VT_NULL:
    break;
default:
    szValue.Empty();
    return FALSE;
}


Smile | :)



Happy, Happy, Joy, Joy.
Generalcopying one array into another -simple question Pin
nss4-Aug-02 13:38
nss4-Aug-02 13:38 
GeneralRe: copying one array into another -simple question Pin
Christian Graus4-Aug-02 14:22
protectorChristian Graus4-Aug-02 14:22 
GeneralRe: copying one array into another -simple question Pin
nss4-Aug-02 15:05
nss4-Aug-02 15:05 
GeneralRe: copying one array into another -simple question Pin
Ravi Bhavnani4-Aug-02 14:53
professionalRavi Bhavnani4-Aug-02 14:53 
GeneralRe: copying one array into another -simple question Pin
Daniel Lohmann5-Aug-02 3:56
Daniel Lohmann5-Aug-02 3:56 
GeneralOO design question Pin
David Wulff4-Aug-02 12:55
David Wulff4-Aug-02 12:55 
GeneralRe: OO design question Pin
Ravi Bhavnani4-Aug-02 15:00
professionalRavi Bhavnani4-Aug-02 15:00 
GeneralRe: OO design question Pin
David Wulff4-Aug-02 15:32
David Wulff4-Aug-02 15:32 
GeneralRe: OO design question Pin
Shog94-Aug-02 19:45
sitebuilderShog94-Aug-02 19:45 
GeneralRe: OO design question Pin
David Wulff5-Aug-02 1:33
David Wulff5-Aug-02 1:33 
GeneralRe: OO design question Pin
Shog95-Aug-02 5:14
sitebuilderShog95-Aug-02 5:14 
GeneralRe: OO design question Pin
David Wulff5-Aug-02 6:46
David Wulff5-Aug-02 6:46 
GeneralRe: OO design question Pin
Stan Shannon5-Aug-02 8:47
Stan Shannon5-Aug-02 8:47 
GeneralRe: OO design question Pin
Stan Shannon5-Aug-02 2:04
Stan Shannon5-Aug-02 2:04 
GeneralRe: OO design question Pin
David Wulff5-Aug-02 2:29
David Wulff5-Aug-02 2:29 
GeneralRe: OO design question Pin
Stan Shannon5-Aug-02 3:43
Stan Shannon5-Aug-02 3:43 
GeneralRe: OO design question Pin
Ravi Bhavnani5-Aug-02 3:37
professionalRavi Bhavnani5-Aug-02 3:37 

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.