[Solved] Error Access2Base setValue with Firebird

Discussions about using 3rd party extension with OpenOffice.org

[Solved] Error Access2Base setValue with Firebird

Postby tsultana » Fri Oct 19, 2018 9:15 pm

Using the OpenRecordset to AddNew a character type field (char or varchar) will produce an error with Firebird. This has been tested on Debian Linux 4.9 with LO 6.1.3 and Win10 with LO 6.1.1 with the same results. Attached is a working HSQLDB and not working Firebird example with the same code.

For the Firebird database the following code errors with the .Fields().Value line when it tries to setValue().
oRec = CurrentDb().OpenRecordset("char_pkey")
oRec.AddNew
oRec.Fields("test").Value = "abcd"
oRec.Update
oRec.mClose

I debugged the Access2Base code stepping into the following modules. Line 704 in _PropertySet() fails because _Precision is set to 0 so any length character field fails on error length. That is not the error reported on line 776 because the problem occurs earlier.

_Precision is a private variable in the module but is not set to a value anywhere and its only use is on line 704 below with the 0 initialization value. When I run the HSQLDB.odb example the _Precision variable has a value of 2147483647 (0x7FFFFFFF) so there may be a difference with initialization?

REM Access2Base:Field Module
17 Private _Precision As Long

127 Property Let Value(ByVal pvValue As Variant)
128 Call _PropertySet("Value", pvValue)
129 End Property ' Value (set)

623 Private Function _PropertySet(ByVal psProperty As String, ByVal pvValue As Variant) As Boolean

655 Case UCase("Value")

664 Select Case Column.Type

702 Case .CHAR, .VARCHAR, .LONGVARCHAR, .CLOB
703 If Not Utils._CheckArgument(pvValue, iArgNr, vbString, , False) Then Goto Trace_Error_Value
704* If Len(pvValue) > _Precision Then Goto Trace_Error_Length
705 Column.updateString(pvValue) ' vbString

Watch Variables
_Precision = 0
pvValue = "abcd"
cstThisSub = "Field.setValue"
iArgNr = 1
psProperty = "Value"

The CurrentDB().RunSQL() works for both HSQLDB and Firebird
CurrentDb().RunSQL("insert into ""char_pkey"" Values ( 'abcd' )")

Thanks,

Tony
Attachments
HSQLDB example.odb
File that runs without errors.
(4.73 KiB) Downloaded 16 times
Firebird Example.odb
File stops with errors.
(4.28 KiB) Downloaded 15 times
Firebird error.png
Fatal error window that stopped execution.
Firebird error.png (8.14 KiB) Viewed 550 times
Last edited by tsultana on Thu Nov 15, 2018 7:22 pm, edited 1 time in total.
LibreOffice 6.1.3.1 Debian Linux 4.9.0-8-amd64
tsultana
 
Posts: 4
Joined: Fri Oct 19, 2018 5:17 pm

Re: Error Access2Base setValue with Firebird

Postby Villeroy » Sat Oct 20, 2018 5:05 pm

Firebird is not compatible with Base, no matter how many APIs and wrappers you throw at it. Until now I have not seen any non-trivial LibreOffice Base document with embedded Firebird.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, OpenOffice 4.x & LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 25852
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Error Access2Base setValue with Firebird

Postby JPL » Thu Nov 15, 2018 5:43 pm

@ tsultana,

thanks for having reported this bug.

A correction has been implemented (already on july '18) for LibreOffice 6.2: see
- https://bugs.documentfoundation.org/sho ... ?id=121424 (your own bug report)
- and https://bugs.documentfoundation.org/sho ... ?id=118680

Regards.
JPL
Windows 7 / LibO 6.0 / AOO 4.1
Ubuntu 18.04 / LibO 6.1
Access2Base extension (AOO) or standard (LibO).
BaseDocumenter extension (LibO)
Documentation on http://www.access2base.com and http://www.access2base.com/basedocumenter
JPL
Volunteer
 
Posts: 97
Joined: Fri Mar 30, 2012 3:14 pm


Return to Extensions

Who is online

Users browsing this forum: robleyd and 3 guests