Conversion from DB_NUMERIC to double?
-
how can i get a double from DB_NUMERIC?? any help will be appreciate. "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox [^]
-
how can i get a double from DB_NUMERIC?? any help will be appreciate. "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox [^]
IDataConvert. You need something like this; DB_NUMERIC dbnumeric ; double dbl; IDataConvert* pCon = NULL; CoCreateInstance(CLSID_OLEDB_CONVERSIONLIBRARY, NULL, CLSCTX_INPROC, IID_IDataConvert, reinterpret_cast(&pCon)); if (SUCCEEDED(pCon->CanConvert(DBTYPE_NUMERIC,DBTYPE_R8))) { pCon->DataConvert(DBTYPE_NUMERIC, DBTYPE_R8, sizeof(struct tagDB_NUMERIC), &dbnumeric, reinterpret_cast(&dbl), sizeof(double)), DBSTATUS_S_OK, 0, dbnumeric.precision,dbnumeric.scale, DBDATACONVERT_DEFAULT); } pCon->Release(); I've omitted error checking on the CoCreateInstance and the conversion itself, but this should help. Steve S