Save decimal to an access db (ADO) - InfoPath Dev
in

InfoPath Dev

Save decimal to an access db (ADO)

Last post 02-01-2007 09:51 AM by leGeneral. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-27-2007 08:31 AM

    Save decimal to an access db (ADO)

    I hope someone could help me solving my problem.

    I design a form as an access frontend. I use code (Jscript,ADO) to save data into the database. So far so good.

    Now I`m trying to save a price and a calculated amount to my db. The price and the amount are formated as decimal and currency. The fields in my db are also formatted as currency. If I try to save a price like 99,99 the result in my db is 9999. It ignores the ",".
    If I format the price as text there is no problem an my result in my db is 99,99.
    But this is not a satisfying solution cause I need decimal values to calculate the amount.

    This is how I assign the price to my recordset:
    rsUmsatz.Fields("VK") = oSrc.selectSingleNode("my:vkUms").text; 

    Any idea?

    Christoph
  • 01-31-2007 01:08 AM In reply to

    Re: Save decimal to an access db (ADO)

    Hi,
    In the access db make the field size to double and select the format as standard to display the decimal values in the field

    Hope this helps you!
    Shilpa
    INFOPATHDEV India
  • 02-01-2007 09:51 AM In reply to

    Re: Save decimal to an access db (ADO)

    So I solved it.

    It was not a problem with my access db. The problem was that Access expected a "," instead of a ".".
    So I had to use a replace function:

    var dblGesamtwert = oSrc.selectSingleNode("my:positionsbetrag").text;
    rsUmsatz.Fields("Gesamtwert") = dblGesamtwert.replace(".",",");


    Christoph
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.