Use ODBC and SQLite in same application

Just starting out? Need help? Post your questions and find answers here.
sc4pb
User
User
Posts: 25
Joined: Tue Mar 07, 2023 5:33 pm

Use ODBC and SQLite in same application

Post 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?
User avatar
Ajm
Enthusiast
Enthusiast
Posts: 233
Joined: Fri Apr 25, 2003 9:27 pm
Location: Kent, UK

Re: Use ODBC and SQLite in same application

Post 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.
Regards

Andy

Image
Registered PB & PureVision User
User avatar
mk-soft
Always Here
Always Here
Posts: 5216
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Use ODBC and SQLite in same application

Post 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)

...
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply