-
Problem in VC++ 6 and Oracle numeric data types
I am currently working on a project that uses CDynamicAccessor to connect
to all databases. The project is data driven, and gets all settings from
a "data dictionary." It works flawlessly with all databases except Oracle.
I have no problems in testing FoxPro, Access, SQL Server 7/2000.
The code segment is below. Any help would be greatly appreciated. All I
get is "============" across the board for any value from oracle.
case DBTYPE_VARNUMERIC:
{
HRESULT hr;
DB_NUMERIC nConvertFrom;
void *pdblNumericConverted;
double dblNumericConverted = 0;
pdblNumericConverted = &dblNumericConverted;
IDataConvert *pIcvt;
hr=CoCreateInstance(CLSID_OLEDB_CONVERSIONLIBRARY, NULL,CLSCTX_INPROC_SERVER,
IID_IDataConvert,
(void **) &pIcvt);
DBSTATUS pdbsStatusNotUsed;
ULONG cbDstLength;
nConvertFrom = *((DB_NUMERIC*)pData);
HRESULT res = pIcvt->DataConvert(DBTYPE_NUMERIC,
VT_R8, // src, dest types
(ULONG) sizeof(struct tagDB_NUMERIC),
&cbDstLength,
&nConvertFrom,
pdblNumericConverted,
NULL ,
DBSTATUS_S_OK,
&pdbsStatusNotUsed,
NULL,
NULL,
DBDATACONVERT_DEFAULT);
if( res == S_OK )
{
varStr = _bstr_t("varnumeric_");
varStr = varStr + _bstr_t(*((double*)dblNumericConverted));
//varStr = varStr + _bstr_t(dblNumericConverted);
}
else
varStr = _bstr_t("***Error During Conversion***");
}
break;
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks