Click here to Skip to main content
15,928,207 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: can't figure out this calculation Pin
Toni7826-May-05 7:53
Toni7826-May-05 7:53 
GeneralCeateProcess Pin
Imtiaz Murtaza26-May-05 5:12
Imtiaz Murtaza26-May-05 5:12 
GeneralRe: CeateProcess Pin
skornel26-May-05 6:39
skornel26-May-05 6:39 
GeneralSetting up hooks to monitor Webpage controls in IE Pin
m_ramesh3126-May-05 5:01
m_ramesh3126-May-05 5:01 
GeneralRe: Setting up hooks to monitor Webpage controls in IE Pin
Shog926-May-05 12:20
sitebuilderShog926-May-05 12:20 
GeneralRe: Setting up hooks to monitor Webpage controls in IE Pin
Waleed Eissa26-May-05 13:09
Waleed Eissa26-May-05 13:09 
GeneralRe: Setting up hooks to monitor Webpage controls in IE Pin
ThatsAlok26-May-05 18:25
ThatsAlok26-May-05 18:25 
GeneralOLEDB Decimal Seperator Wrong! Pin
Chris Ulliott26-May-05 4:40
Chris Ulliott26-May-05 4:40 
Hi All,

Using VC6 I am connecting to a database via OLEDB/ODBC. My locale
regional settings are set to French while I investigate this problem.

When I read values from a table, I convert everything to strings like
the following:

m_pCommand->AddBindEntry(l+1, DBTYPE_WSTR, sizeof(TCHAR)*256,<br />
&m_pColumns[l].szValue, NULL, &m_pColumns[l].dwStatus);


So as you can see, all fields are bound to DBTYPE_WSTR

Now when I read a currency value or a numeric value with decimal
places, the value ALWAYS looks like this "23.23" when it should look
like "23,23" with my current regional settings. The decimal seperator
is a ',' and not a '.'

If I query the database with Access, Excel, Crystal Reports they always
give me the correct values with correct decimal seperators so I feel I
must be missing a trick.

I connect to the database like this:
CComPtr<IDBPromptInitialize> spDBInit;<br />
hResult = CoCreateInstance(CLSID_DataLinks, NULL, CLSCTX_INPROC_SERVER,<br />
IID_IDBPromptInitialize, (void**) &spDBInit);<br />
<br />
if (hResult != S_OK)<br />
        return RES_DBCONNECTION_OPEN_DATALINKS;<br />
<br />
DBPROMPTOPTIONS dwPromptOptions = DBPROMPTOPTIONS_WIZARDSHEET;<br />
CComPtr<IDBProperties> spIDBProperties;<br />
<br />
hResult = spDBInit->PromptDataSource(NULL, m_hProgressDlg,<br />
dwPromptOptions, 0, NULL, NULL, IID_IDBProperties,<br />
(IUnknown**)&spIDBProperties);<br />
<br />
if (hResult != S_OK)<br />
{<br />
        if (hResult == DB_E_CANCELED) {<br />
                return RES_CANCELED;<br />
        } else {<br />
                ShowOLEDBErrors(hResult);<br />
                return RES_DBCONNECTION_OPEN_DATALINKS;<br />
        }<br />
<br />
}<br />
<br />
LCID locale = GetUserDefaultLCID();<br />
CDBPropSet      dbInit(DBPROPSET_DBINIT);<br />
<br />
dbInit.AddProperty(DBPROP_INIT_HWND, (long int)m_hProgressDlg);<br />
dbInit.AddProperty(DBPROP_INIT_PROMPT, (short)DBPROMPT_COMPLETE);<br />
dbInit.AddProperty(DBPROP_COMMITPRESERVE, (bool)TRUE);<br />
dbInit.AddProperty(DBPROP_ABORTPRESERVE, (bool)TRUE);<br />
dbInit.AddProperty(DBPROP_INIT_LCID, (long int)locale);<br />
spIDBProperties->SetProperties(1, &dbInit);<br />
<br />
hResult = spIDBProperties->QueryInterface(&m_source.m_spInit);<br />
if (hResult != S_OK)<br />
{<br />
        ShowOLEDBErrors(hResult);<br />
        return RES_DBCONNECTION_OPEN_DATALINKS;<br />
}<br />
<br />
hResult = m_source.m_spInit->Initialize();

There is a microsoft article that I thought may be making things wrong
which is at
http://support.microsoft.com/defaul...;EN-US;Q320744& But
the resolutions suggested have made no effect.

Any suggestions that anyone could offer would be greatly appreciated.

Thank you,
Chris
GeneralReading a file Pin
Andrew Admire26-May-05 4:37
Andrew Admire26-May-05 4:37 
GeneralRe: Reading a file Pin
toxcct26-May-05 4:45
toxcct26-May-05 4:45 
GeneralRe: Reading a file Pin
Andrew Admire26-May-05 5:10
Andrew Admire26-May-05 5:10 
GeneralRe: Reading a file Pin
Andrew Admire26-May-05 9:26
Andrew Admire26-May-05 9:26 
GeneralRe: Reading a file Pin
ThatsAlok26-May-05 21:40
ThatsAlok26-May-05 21:40 
GeneralRe: Reading a file Pin
Andrew Admire27-May-05 3:41
Andrew Admire27-May-05 3:41 
GeneralAddSlashes Pin
talkster526-May-05 3:42
talkster526-May-05 3:42 
GeneralRe: AddSlashes Pin
David Crow26-May-05 3:55
David Crow26-May-05 3:55 
GeneralRe: AddSlashes Pin
talkster526-May-05 4:16
talkster526-May-05 4:16 
GeneralRe: AddSlashes Pin
John M. Drescher26-May-05 4:26
John M. Drescher26-May-05 4:26 
GeneralRe: AddSlashes Pin
talkster526-May-05 4:30
talkster526-May-05 4:30 
GeneralRe: AddSlashes Pin
Ravi Bhavnani26-May-05 4:36
professionalRavi Bhavnani26-May-05 4:36 
GeneralRe: AddSlashes Pin
John M. Drescher26-May-05 4:48
John M. Drescher26-May-05 4:48 
GeneralRe: AddSlashes Pin
toxcct26-May-05 5:02
toxcct26-May-05 5:02 
GeneralRe: AddSlashes Pin
David Crow26-May-05 4:50
David Crow26-May-05 4:50 
GeneralRe: AddSlashes Pin
toxcct26-May-05 4:27
toxcct26-May-05 4:27 
GeneralRe: AddSlashes Pin
talkster526-May-05 8:12
talkster526-May-05 8:12 

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.