It sounds like you are trying to use SQLite in a client-server mode. It isn't designed for that. You should read this discussion of when to use SQLite vs. a traditional client-server database engine.people on different computers
It sounds like you are trying to use SQLite in a client-server mode. It isn't designed for that. You should read this discussion of when to use SQLite vs. a traditional client-server database engine.people on different computers
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Thank you d_stranz, I didn't know there was a difference.
Because the computers I'm working on don't have MySQL I think I can go with ODBC. However, I'm not sure how to go about connecting to the database now. With SQLite, I can simply put db.setDatabaseName(database_location) where database_location is the literal location of the database, but with ODBC, I don't think it doesn't work like that. Any suggestions?
ODBC is just an alternative database driver (see here); you still must connect to an actual database engine like MySQL, PostgreSQL, or Microsoft SQLServer. If you continue to use an SQLite-based engine, you'll have the same issues you have now.I think I can go with ODBC.
As the article I pointed to in my first post describes, you can develop a client-server system based on SQLite. You have to implement a server that runs on the machine where the database file lives. That server can use SQLite as its DBMS, but that is hidden. It has to wrap access to the database to prevent simultaneous access by remote clients. The remote clients do not use SQLite, but access the server through a network-based protocol.
If you have only two tables, then you could use a simple protocol like SOAP (there are some Qt SOAP implementations - Google for them) to send SQL queries from client to server and receive replies. You can develop a QAbstractItemModel to map these replies into something you can display in table views in your clients.
It might be easier to just use a true concurrent client-server DBMS.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Bookmarks