Click here to Skip to main content
16,007,472 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to convert ip address to www address? Pin
Maer72722-Aug-01 6:29
Maer72722-Aug-01 6:29 
GeneralRe: How to convert ip address to www address? Pin
markkuk22-Aug-01 20:55
markkuk22-Aug-01 20:55 
GeneralRe: How to convert ip address to www address? Pin
Maer72723-Aug-01 4:47
Maer72723-Aug-01 4:47 
GeneralRe: How to convert ip address to www address? Pin
markkuk23-Aug-01 21:03
markkuk23-Aug-01 21:03 
GeneralRe: How to convert ip address to www address? Pin
Maer72724-Aug-01 3:08
Maer72724-Aug-01 3:08 
GeneralRecieve commands from CEdit popup menu Pin
21-Aug-01 20:59
suss21-Aug-01 20:59 
GeneralRe: Recieve commands from CEdit popup menu Pin
Tomasz Sowinski22-Aug-01 0:17
Tomasz Sowinski22-Aug-01 0:17 
GeneralNumeric type conversion Pin
Jimmy Ehrnström21-Aug-01 20:39
Jimmy Ehrnström21-Aug-01 20:39 
I'm having problems updating a database table containing a couple of numeric fields (length=3, precision=4, scale=2) on a MS SQL Server.

When I call the Update method on my CRecordset derived class I get an "Invalid character value for cast specification" error.

I know this is caused by the numeric fields, since without them it works alright.

When I generated my recordset using the class wizard it set the type of these fields as CString, which I assume is because the ODBC driver does not support the numeric datatype. Thus it tries to convert the numeric to a string when reading from the database, and back to a numeric when writing. All this is beyond my control.

What I'm trying to figure out is how to update these fields without getting the above mentioned error message.

Here's a simplified version of my code:

mySet.Open(CRecordset::snapshot, NULL, CRecordset::none); // Selects a unique record in my database (verified)
mySet.Edit();
mySet.m_MyNumeric1 = "2,00";
// In Sweden we used , instead of . as a decimal separator so that's why the
// above value might look suspicious to most of you.
// I've tried changing this field to "2.00" too, but the result is the same.
// The value is also stored with , as separator in the database.
mySet.Update() // Causes the above mentioned exception to be thrown.

I'm starting to fear that this problem is caused by a conflict between . and , in the driver. I've tried changing the field to almost anything by now, but nothing seems to help.

Does anyone recognize this problem? Some tips would be much appreciated.
GeneralRe: Numeric type conversion Pin
22-Aug-01 7:31
suss22-Aug-01 7:31 
QuestionHow "Window" menu works Pin
21-Aug-01 19:34
suss21-Aug-01 19:34 
AnswerRe: How Pin
Tomasz Sowinski21-Aug-01 23:40
Tomasz Sowinski21-Aug-01 23:40 
GeneralCustom buttons in title bar Pin
marutis21-Aug-01 19:27
marutis21-Aug-01 19:27 
GeneralRe: Custom buttons in title bar Pin
Tommy H D Svensson22-Aug-01 0:53
Tommy H D Svensson22-Aug-01 0:53 
QuestionCComboBox resize list part of control??? Pin
21-Aug-01 19:20
suss21-Aug-01 19:20 
AnswerRe: CComboBox resize list part of control??? Pin
Andreas Saurwein22-Aug-01 13:32
Andreas Saurwein22-Aug-01 13:32 
QuestionWindows' program porting to Macintosh? Pin
hardhorse21-Aug-01 18:39
hardhorse21-Aug-01 18:39 
QuestionHow to transfer OLE Item? Pin
haozl21-Aug-01 17:40
haozl21-Aug-01 17:40 
Questionwhat is this infomation meaning when debuging? Pin
Sandos Ganzales21-Aug-01 17:38
Sandos Ganzales21-Aug-01 17:38 
AnswerRe: what is this infomation meaning when debuging? Pin
Orbital^21-Aug-01 19:51
Orbital^21-Aug-01 19:51 
GeneralComparing 2 colors similarity Pin
Wolfram Steinke21-Aug-01 16:06
Wolfram Steinke21-Aug-01 16:06 
GeneralRe: Comparing 2 colors similarity Pin
Christian Graus21-Aug-01 16:17
protectorChristian Graus21-Aug-01 16:17 
GeneralRe: Comparing 2 colors similarity Pin
Wolfram Steinke21-Aug-01 17:21
Wolfram Steinke21-Aug-01 17:21 
GeneralRe: Comparing 2 colors similarity Pin
Christian Graus22-Aug-01 1:56
protectorChristian Graus22-Aug-01 1:56 
GeneralRe: Comparing 2 colors similarity Pin
Wolfram Steinke22-Aug-01 2:09
Wolfram Steinke22-Aug-01 2:09 
GeneralRe: Comparing 2 colors similarity Pin
Christian Graus22-Aug-01 2:57
protectorChristian Graus22-Aug-01 2:57 

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.