Bug 140261 - Subforms not usable when using JDBC
Summary: Subforms not usable when using JDBC
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.0.4.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-08 08:59 UTC by micke82
Modified: 2021-08-31 11:56 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Test document (10.07 KB, application/vnd.sun.xml.base)
2021-02-08 08:59 UTC, micke82
Details
Form error message (3.75 KB, image/png)
2021-02-08 09:00 UTC, micke82
Details
MS SQL test database (8.22 KB, application/octet-stream)
2021-02-08 09:01 UTC, micke82
Details

Note You need to log in before you can comment on or make changes to this bug.
Description micke82 2021-02-08 08:59:58 UTC
Created attachment 169573 [details]
Test document

I created a new database that is connected to Microsoft SQL Server Express 2019:

JDBC driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver
Datasource: sqlserver://127.0.0.1:1433;databaseName=test

The database contains the two tables Table_1 and Table_2.

Form wizard is used to create a main form of table_1 with a subform of table_2.

When the form is opened error "The data could not be loaded." "The index 1 is out of range" appears. The main form appears to work but the subform does not display any data at all.
Comment 1 micke82 2021-02-08 09:00:18 UTC
Created attachment 169574 [details]
Form error message
Comment 2 micke82 2021-02-08 09:01:27 UTC
Created attachment 169575 [details]
MS SQL test database
Comment 3 Robert Großkopf 2021-08-29 07:07:11 UTC
Have had a look at this.
Inside the *.odb-file is a file "content.xml" Could be seen with a packing program. This file contains
 db:parameter-name-substitution="false"
which shouldn't be "false". Set it to "true".

You could do this by opening the database, go to 
Edit → Database → Advanced settings 
and choose "Replace named Parameters with '?'"

If it is chosen the subforms should work.
Comment 4 Robert Großkopf 2021-08-29 07:08:49 UTC
Please close this bug as WORKSFORME, if it doesn't exist any more after changing "Replace named Parameters with '?'"
Comment 5 micke82 2021-08-30 09:05:59 UTC
Thank you for looking into this. Is this bug fixed or must the workaround be used for each new document created?
Comment 6 Robert Großkopf 2021-08-30 14:40:02 UTC
(In reply to micke82 from comment #5)
> Thank you for looking into this. Is this bug fixed or must the workaround be
> used for each new document created?

If you could change the behavior by setting

Edit → Database → Advanced settings 
and choose "Replace named Parameters with '?'"

it isn't a bug. You had chosen a JDBC-connection. You have to know if the database, which you try to connect, will allow to replace named parameters by '?'. Seems there are databases, which doesn't allow it. So it is set to 'no' by default.

If the problem appears and there is no possibility to change this in the GUI it will be a bug.
Comment 7 micke82 2021-08-31 07:04:43 UTC
Thank you for the clarification. 

I did the same thing with ODBC and it was working. So I guess this is a property (limitation?) of the driver and not the database.
Comment 8 Robert Großkopf 2021-08-31 11:56:51 UTC
I will set this one to WORKSFORME, because it could be solved by an entry in GUI.