By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,554 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,554 IT Pros & Developers. It's quick & easy.

Decimal separator in Access database

P: 5
Hello all!

Situation is as follows:
- Access database file, decimal field (18,2)
- Visual Basic 2005
- ADO connection

When I put Datagrid on the form, I see the value correctly, and I can change it.
But, when I try to put a textbox on another form, referencing to the same data, the data reads correctly (for example: 1,23), but when I change it (to for example: 4,56) and save it, it saves as (456) in the database.
Regional settings are set to Croatian in Windows, and Dataset locale is set to hr-HR.

Anybody has a clue what should I do?

Thanks a lot in advance!

Marko
Nov 26 '07 #1
Share this Question
Share on Google+
7 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

Do you have Comma "," as Decimal Seperator...?

Regards
Veena
Nov 26 '07 #2

P: 5
Hi Veena.

Yes, I forgot to state. I have comma as decimal separator.

Marko
Nov 26 '07 #3

QVeen72
Expert 100+
P: 1,445
Hi,

If your TextBox, is Bound To dataSource, then
You can Set the DataFormat, in PropertySheet >Databinding Advanced
set it to Numeric.
Or else, While Saving to Database, use
CDec(TextBox1.Text)
CDec Converts the Contents to Decimal Format..

Regards
Veena
Nov 26 '07 #4

P: 5
Great, thanks, will try that and let you know if it works.
Nov 26 '07 #5

P: 5
Hi again.

Ive set the property to Numeric and I got data type mismatch. Then Ive changed the data type from Decimal to Double in Dataset (.xsd file). Tryed again, and everything is like I never changed anything: I enter 1,23, and I get 123 in the database.
Ive checked the content of dataset.designer.vb file, and the data types are correct.

I've checked with CDec and I get 1,23 when I msgbox it. Ive also tryed with NumericUpDown control, and I also get 123 in the database. The other fields update normaly and correctly.

Are there any other things I could check? Any idea?

Marko
Nov 26 '07 #6

QVeen72
Expert 100+
P: 1,445
Hi,

As you say CDec works Fine, Let me know how you are updating the dataset from textbox..?
post your code here..

Regards
Veena
Nov 27 '07 #7

P: 5
I still havent solved the problem, so if anyone knows, help would be very appreciated.
Thanks!
Dec 3 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.