diff options
author | Jean-Pierre Ledure <jp@ledure.be> | 2017-05-25 18:07:56 +0200 |
---|---|---|
committer | Jean-Pierre Ledure <jp@ledure.be> | 2017-05-25 18:07:56 +0200 |
commit | 4be228af5ae177ad0057613ef0a98d6cc1b67584 (patch) | |
tree | 7a806e0f37d087bbc3e1469b1293e0c978d74ff7 /wizards | |
parent | a05dc747caf5b8fef6bd95a999cb6098f2b4dbc7 (diff) |
Access2Base - Value property of DECIMAL fields
Avoid overflow on CLng function
Change-Id: I75dc25299cbfbc1fff9eeac4e2a8d2f3e8ed7d85
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/source/access2base/Field.xba | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/wizards/source/access2base/Field.xba b/wizards/source/access2base/Field.xba index 651ae6ec64b6..b52938641710 100644 --- a/wizards/source/access2base/Field.xba +++ b/wizards/source/access2base/Field.xba @@ -545,12 +545,19 @@ Const cstMaxBinlength = 2 * 65535 If Utils._hasUNOProperty(Column, "Scale") Then If Column.Scale > 0 Then vValue = Column.getDouble() - Else ' CLng checks local decimal point, getString does not ! + Else ' Try Long otherwise Double (CDec not implemented anymore in LO ?!?) + On Local Error Resume Next ' Avoid overflow error + ' CLng checks local decimal point, getString does not ! sValue = Join(Split(Column.getString(), "."), Utils._DecimalPoint()) - vValue = CLng(sValue) ' CDec disappeared from LO ?!? + vValue = CLng(sValue) + If Err <> 0 Then + vValue = CDbl(sValue) + Err.Clear + On Local Error Goto Error_Function + End If End If Else - vValue = CDec(Column.getString()) + vValue = CDbl(Column.getString()) End If Case .CHAR : vValue = Column.getString() Case .VARCHAR : vValue = Column.getString() ' vbString |