I can't find an answer on the Qt forums. I hope someone here can help. I do I establish a connection from Qt to a LibreOffice Base database on the same Linux box where I'm running Qt Creator. I have tried
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
db.setDatabaseName("/home/bill/Macro/Addresses.odb");
with various settings for password and user (the database requires neither) but nothing works. Thanks.
[Solved] Connect from Qt
[Solved] Connect from Qt
Last edited by MrProgrammer on Sun Jun 25, 2023 3:39 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
LibreOffice 7.3.7.2 on Linux Mint 21 Cinnamon 5.4.12
Re: Connect from Qt
Base is not a database. Base is a client tool to work with databases in the context of the office suite. Base provides database access to office documents but not to the outside world. When you open your "/home/bill/Macro/Addresses.odb", the status bar indicates the actual database. It may be embedded in the odb, it may be a spreadsheet, a directory of text files, some connection to a true database (MySQL, PostgreSQL, SQLite, Firebird, dBase, Oracle, ...). That would be the the source you may be able to connect via QODBC.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Connect from Qt
Thanks so much, Villeroy. This answers a number of issues I was having.
LibreOffice 7.3.7.2 on Linux Mint 21 Cinnamon 5.4.12