I have a question regarding connecting to a SQLite database or rather connecting to two different databases from a single stack. So basically I have two datagrids in a stack on separate cards that I display data from two SQLite databases I have created. When I connect to one of them, everything is fine and I close the DB connection before moving to the next card. The issue is when I make a new connection to the second DB query the database, it gives me an invalid ID connection error. I assume it has something to do with the first connection being open first. I am using the basic syntax given in the LC lessons to connect to a SQLite DB. So overall, my question would be this....Do I need to create a completely different connection string with different variables if I need to connect to multiple databases? Here is my connection code...
Code: Select all
command databaseConnectDailyLog
local tDatabasePath
## The database must be in a writeable location
put specialFolderPath("0x0023") & "/dailyLogDB.sqlite" into tDatabasePath
## Open a connection to the database
## If the database does not already exist it will be created
put revOpenDatabase("sqlite", tDatabasePath, , , , ) into tDatabaseID
## Store the database id so other handlers can access it
setDatabaseID tDatabaseID
end databaseConnectDailyLog