reading database with ADOB
i tried this code to read from access DB
and when i access a cell that is empty and not null with this code :
PHP Code:
name =_strdup((char*) ((_bstr_t)(pConnectRead->GetFields()->GetItem("name")->GetValue())) );
then i get an error : type mismatch
why is that?
thnaks in advance
peleg
Re: reading database with ADOB
Quote:
Originally Posted by pelegk2
i tried this code to read from access DB
and when i access a cell that is empty and not null with this code :
PHP Code:
name =_strdup((char*) ((_bstr_t)(pConnectRead->GetFields()->GetItem("name")->GetValue())) );
then i get an error : type mismatch
why is that?
thnaks in advance
peleg
Try this:
COleVariant Var;
Var = recordset->Fields->GetItem("FirstName")->Value;
firstName = ( Var.vt == VT_NULL ? _T("") : ((char *) (_bstr_t)Var.bstrVal) );
This above code definitely works.
Hope this helps.