summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorJean-Pierre Ledure <jp@ledure.be>2017-05-25 18:07:56 +0200
committerJean-Pierre Ledure <jp@ledure.be>2017-05-25 18:07:56 +0200
commit4be228af5ae177ad0057613ef0a98d6cc1b67584 (patch)
tree7a806e0f37d087bbc3e1469b1293e0c978d74ff7 /wizards
parenta05dc747caf5b8fef6bd95a999cb6098f2b4dbc7 (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.xba13
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, &quot;Scale&quot;) Then
If Column.Scale &gt; 0 Then
vValue = Column.getDouble()
- Else &apos; CLng checks local decimal point, getString does not !
+ Else &apos; Try Long otherwise Double (CDec not implemented anymore in LO ?!?)
+ On Local Error Resume Next &apos; Avoid overflow error
+ &apos; CLng checks local decimal point, getString does not !
sValue = Join(Split(Column.getString(), &quot;.&quot;), Utils._DecimalPoint())
- vValue = CLng(sValue) &apos; CDec disappeared from LO ?!?
+ vValue = CLng(sValue)
+ If Err &lt;&gt; 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() &apos; vbString