I can't seem to get the Decimal datatype to work. I thought it would store sevaral digits after the decimal point. In my testing, I am trying to insert the following value:
.123456789
But in datasheet view it just shows a value of zero after the insert. I know the insert is successful, because the other fields did just fine. This is the code I'm using (this is a native Access table)
Sql = "INSERT INTO testTable....."
Call cmd.Parameters.Append(cmd.CreateParameter("@Num", adDecimal))
cmd.Parameters("@Num").Value = .12345789
cmd.Execute
If I change the value to an integer it works fine, like this:
cmd.Parameters("@Num").Value = 2500
but the problem is that I need to insert decimal numbers. In design view, the datatype for this column is "Decimal" and the "Precision" is 18. So why isn't the engine preserving up to 18 digits past the decimal point?
I am using ADOB and I tried setting the param length but that didn't help either.
.123456789
But in datasheet view it just shows a value of zero after the insert. I know the insert is successful, because the other fields did just fine. This is the code I'm using (this is a native Access table)
Sql = "INSERT INTO testTable....."
Call cmd.Parameters.Append(cmd.CreateParameter("@Num", adDecimal))
cmd.Parameters("@Num").Value = .12345789
cmd.Execute
If I change the value to an integer it works fine, like this:
cmd.Parameters("@Num").Value = 2500
but the problem is that I need to insert decimal numbers. In design view, the datatype for this column is "Decimal" and the "Precision" is 18. So why isn't the engine preserving up to 18 digits past the decimal point?
I am using ADOB and I tried setting the param length but that didn't help either.
Last edited: