Page 1 of 1

Use ODBC and SQLite in same application

Posted: Wed Nov 29, 2023 7:19 pm
by sc4pb
I have a project where I need to access a local SQLite database, and transfer data to a remote ODBC database. Is it possible to call both UseODBCDatabase() and UseSQLiteDatabase() in the same application so that I can connect to either db as needed with OpenDatabase?

Re: Use ODBC and SQLite in same application

Posted: Wed Nov 29, 2023 7:25 pm
by Ajm
Yes you can. I have an application that does exactly that. As long as your Id for each database connection is different it works without issue.

Re: Use ODBC and SQLite in same application

Posted: Wed Nov 29, 2023 10:38 pm
by mk-soft
Base ...

Code: Select all

UseODBCDatabase()
UseSQLiteDatabase()

db1 = OpenDatabase(#PB_Any, Your-ODBC-Database, "", "", #PB_Database_ODBC)
db2 = OpenDatabase(#PB_Any, Your-SQLite-Database, "", "", #PB_Database_SQLite)

...