[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc even when ODB registered.

2019-11-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

Alex Thurgood  changed:

   What|Removed |Added

Summary|Firebird database must be   |Firebird database must be
   |opened at all times in  |opened at all times in
   |order to insert data using  |order to insert data using
   |BASIC of Calc.  |BASIC of Calc even when ODB
   ||registered.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

Alex Thurgood  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

Alex Thurgood  changed:

   What|Removed |Added

 OS|Linux (All) |All
 CC||btom...@gmail.com,
   ||ipla...@tuta.io,
   ||lio...@mamane.lu

--- Comment #17 from Alex Thurgood  ---
(In reply to Stang from comment #16)
> With further testing, can get to FLUSH.  Doing this with the connection,
> just need to add another line in the macro after the SQL executeUpdate and
> before the close() line:
> 
> Conn.getParent().flush
> 
> Now data is saved to Firebird embedded without it being opened.

@Stang: thanks for your tests !

>From memory, the .getParent call is what binds the form (be it Calc or an
independent Writer form) to the connection context (in the MVC world of UNO),
so this is indeed the issue with the commit failing in normal use, i.e. the
failure to find the parent if the ODB file isn't open simultaneously.

However, if this now works for embedded hsqldb, then it should also work for
Firebird...so perhaps the code that creates an embedded Firebird ODB file fails
to expose that MVC correctly ?

I'm not up to date with the way MVC works in the context of an embedded
Firebird ODB, but really we ought to be striving to obtain the same thing.

@Lionel, Tamas : putting you on copy for thoughts on this?

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-11 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

--- Comment #16 from Stang  ---
With further testing, can get to FLUSH.  Doing this with the connection, just
need to add another line in the macro after the SQL executeUpdate and before
the close() line:

Conn.getParent().flush

Now data is saved to Firebird embedded without it being opened.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-11 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

--- Comment #15 from Stang  ---
@Alex

Interestingly enough, with your comment went back and re-tested tdf#112458 and
that now works for HSQLDB embedded.  However not for Firebird embedded and the
flush command is not valid - see attachment there.

For this report, FLUSH gives same error for both HSQLDB and Firebird embedded. 
Also keep in mind this deals strictly with SQL and not a form although I tested
this using a form in Calc also.

Still appears both issues, at least with Firebird, involve the commit
situation.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-11 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

Alex Thurgood  changed:

   What|Removed |Added

   See Also||https://bugs.documentfounda
   ||tion.org/show_bug.cgi?id=11
   ||2458

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-11 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

--- Comment #14 from Alex Thurgood  ---
@Stang : thanks!

Seems to be a duplicate of bug 112458 ?

Whilst in this case it is a macro executed SQL update statement that is
executed, the data isn't saved to the database file if the ODB file isn't
opened or loaded in memory (hidden should also be possible)

As Robert mentioned in comment 10 of bug 112458, there would appear to be a
workaround using the active connection FLUSH command.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-09 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

--- Comment #13 from Stang  ---
There appears to be two problems with the original post. The first is the Calc
file code.  In `Sub UpdateSQL_Original` this statement:

Dim TestDate AS Date

should be:

Dim TestDate AS String

This corrects the error seen by @Alex Thurgood.

The second problem is the title of the bug.  The database does not need to be
open to process the SQL transactions.  The actual problem is with the
registered database never opened, if the Calc file is closed, a Commit is not
issued to the Firebird DB and the data is thus not saved.  There also does not
seem to be any method to send a Commit from Calc to accommodate this.

If before closing The Calc file, the Base file is opened and saved (save
indicator is on at this point), the data is saved (committed).

There is no warning anywhere when in Calc that upon closing the database data
needs to be saved.

Confirmed with:

Version: 6.3.3.2
Build ID: a64200df03143b798afd1ec74a12ab50359878ed
CPU threads: 8; OS: Linux 5.0; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-09 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

--- Comment #12 from Nukool Chompuparn  ---
Created attachment 155664
  --> https://bugs.documentfoundation.org/attachment.cgi?id=155664=edit
HSQLDB

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-09 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

--- Comment #11 from Nukool Chompuparn  ---
Created attachment 155663
  --> https://bugs.documentfoundation.org/attachment.cgi?id=155663=edit
Working with embedded HQSQLDB, no need to open database

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-09 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

--- Comment #10 from Nukool Chompuparn  ---
Created attachment 155662
  --> https://bugs.documentfoundation.org/attachment.cgi?id=155662=edit
New record inserted

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-09 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

--- Comment #9 from Nukool Chompuparn  ---
Created attachment 155661
  --> https://bugs.documentfoundation.org/attachment.cgi?id=155661=edit
SQL statement used

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-09 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

--- Comment #8 from Nukool Chompuparn  ---
Created attachment 155660
  --> https://bugs.documentfoundation.org/attachment.cgi?id=155660=edit
>From your sample data in cell A10

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-08 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

--- Comment #7 from Nukool Chompuparn  ---
(In reply to Alex Thurgood from comment #5)
> @Nukool : thanks !
> 
> You did register your ODB file with the LO application environment first
> didn't you ?
> 
> If you read the macro code in the Calc file, it requires a database context
> to be correctly setup :
> 
> rem Change this for your registered Base name
> Dim dbNAME As String : dbNAME = "REG_AA"  
> ' 'Add Dim dbNAME As String
> : >>> REG_AA
> Db = Context.getByName(dbNAME)
> 
> In other words, you are advised to register the database with the LO
> environment through 
> 
> Tools > Options > LibreOffice Base > Databases > New
> 
> If you load REG_AAA into LO then the database context is automatically
> established, and running the macro will let you write to the database for as
> long the ODB file is in memory.
> 
> However, if you just try running the macro without having registered the
> database with the LO environment so that it knows where to find (and load)
> the ODB file, then running the macro will fail.
> 
> 
> 
> Note that if I register the ODB with the LO environment, when I try to run
> the Update_SQLOriginal macro, I get an error message:
> 
> Erreur d'exécution BASIC.
> Une exception s'est produite : 
> Type: com.sun.star.sdbc.SQLException
> Message: firebird_sdbc error:
> *conversion error from string "23/02/2019"
> caused by
> 'INSERT INTO "TABLE3" ("NAME", "Note") VALUES ('Input 104', '23/02/2019');'
> .
> 
> 
> I get this error irrespective of whether the ODB is file is loaded or not.

Yes, I have registered.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-07 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

--- Comment #6 from Alex Thurgood  ---
Tested with 
Version: 6.3.1.2
Build ID: b79626edf0065ac373bd1df5c28bd630b4424273
Threads CPU : 4; OS : Mac OS X 10.15.1; UI Render : par défaut; VCL: osx; 
Locale : fr-FR (fr_FR.UTF-8); Langue IHM : fr-FR
Calc: threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-07 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

--- Comment #5 from Alex Thurgood  ---
@Nukool : thanks !

You did register your ODB file with the LO application environment first didn't
you ?

If you read the macro code in the Calc file, it requires a database context to
be correctly setup :

rem Change this for your registered Base name
Dim dbNAME As String : dbNAME = "REG_AA"   
' 'Add Dim dbNAME As String : >>> REG_AA
Db = Context.getByName(dbNAME)

In other words, you are advised to register the database with the LO
environment through 

Tools > Options > LibreOffice Base > Databases > New

If you load REG_AAA into LO then the database context is automatically
established, and running the macro will let you write to the database for as
long the ODB file is in memory.

However, if you just try running the macro without having registered the
database with the LO environment so that it knows where to find (and load) the
ODB file, then running the macro will fail.



Note that if I register the ODB with the LO environment, when I try to run the
Update_SQLOriginal macro, I get an error message:

Erreur d'exécution BASIC.
Une exception s'est produite : 
Type: com.sun.star.sdbc.SQLException
Message: firebird_sdbc error:
*conversion error from string "23/02/2019"
caused by
'INSERT INTO "TABLE3" ("NAME", "Note") VALUES ('Input 104', '23/02/2019');'
.


I get this error irrespective of whether the ODB is file is loaded or not.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-06 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

--- Comment #4 from QA Administrators  ---
[Automated Action] NeedInfo-To-Unconfirmed

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-06 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

Nukool Chompuparn  changed:

   What|Removed |Added

 CC||nuk...@gmail.com

--- Comment #3 from Nukool Chompuparn  ---
Created attachment 155596
  --> https://bugs.documentfoundation.org/attachment.cgi?id=155596=edit
This is the related/embedded Firebird database file

Thank you so much in advance, now I have to use HSQLDB for solving unexpected
problems.
Expecting to hearing a good news from you shortly and I will move to Firebird
then.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-06 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

Nukool Chompuparn  changed:

   What|Removed |Added

 Ever confirmed|1   |0
 Status|NEEDINFO|UNCONFIRMED

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-06 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

--- Comment #2 from Nukool Chompuparn  ---
Created attachment 155595
  --> https://bugs.documentfoundation.org/attachment.cgi?id=155595=edit
Calc with LibreOffice BASIC

1. Change data in cell A10. 
2. Run UpdateSQL_Original without opening database file REG_AA.
3. Open database file REG_AA, you will find no new record.
4. Do not close database file REG_AA.
5. Run UpdateSQL_Original.
6. Open database file REG_AA, you will find new record inserted.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 128607] Firebird database must be opened at all times in order to insert data using BASIC of Calc.

2019-11-06 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=128607

Alex Thurgood  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEEDINFO

--- Comment #1 from Alex Thurgood  ---
@Nukool: we need a sample ODB and Calc file with basic macros in order to
attempt to reproduce this.

Please also provide detailed instructions on how to proceed to show the buggy
behaviour.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs