Re: Strange calculation

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Oct 3, 9:46 pm, "Ken Snell \(MVP\)"
<kthsneisll...@xxxxxxxxxxxxxxxxxx> wrote:
One more time - as soon as I try to store this value, it sets back to
434.090.
Starting to pull my hair out.

I've looked at the scale, precision anddecimalplaces fields for each of
the
number (decimal) data types, and they're all adequate to hold enough
decimals.

See my first reply to you in this thread....

Why, have you been able to reproduce the problem? I haven't and I'd
hesitate in prescribing a solution involving altering the design of
the table until I had.

FWIW I've seen similar errors where values with some characteristics
get truncated using ADO recordsets with certain cursor types (although
this doesn't appear to fit the OP's scenario) e.g.

Sub DecTrucErr()
Kill Environ$("temp") & "\DropMe.mdb"
Dim rs
Dim cat
Set cat = CreateObject("ADOX.Catalog")
cat.Create _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & _
Environ$("temp") & "\DropMe.mdb"
Set rs = cat.ActiveConnection.Execute( _
"SELECT 1.1 / 10;")
MsgBox rs.GetString
' Returns 0.11 -- correct
Dim con
Set con = CreateObject("ADODB.Connection")
With con
.ConnectionString = _
cat.ActiveConnection.ConnectionString
.CursorLocation = 3
.Open
Set rs = .Execute( _
"SELECT 1.1 / 10;")
MsgBox rs.GetString
' Returns 0.1 -- incorrect, truncated
End With
End Sub

Jamie.

--


.



Relevant Pages

  • Re: Display numbers in different bases
    ... including decimals, from base 2 to base 62. ... Dim LDI As Integer 'Leading Digit Index ... Exit Function ...
    (microsoft.public.excel.misc)
  • RE: Packed decimal arithmetic in C
    ... you need to run computations in more than 5 decimals places, ... >Incoming mail is certified Virus Free. ... Outgoing mail is certified Virus Free. ...
    (comp.os.vms)
  • Re: Change number of decimals but retain original style
    ... Dim StyleNamesToChange As Variant ... Dim WorkedOk As Boolean ... Dim cCtr As Long ... The native increase/decrease decimals command applies the number format of ...
    (microsoft.public.excel.misc)
  • Re: Decimal, __radd__, and custom numeric types...
    ... > custom data types. ... > The problem is that they only work with Decimals if the custom type is ... > You can interact Decimal only with int, long or Decimal data types." ... TypeError exception is raised. ...
    (comp.lang.python)
  • Re: VB DataType equivalent of ADO adBigInt Type
    ... compared to other data types. ... Dim rs As ADODB.Recordset ... The code you supplied here is very useful to determine what kind of datatype is passed in from a RecordSet. ... I need it the other way around: given a binary stream and a description file, return a RecordSet containing a BigInt. ...
    (microsoft.public.vb.general.discussion)