QSqlDatabase never fails
I am just starting to explore Qt support for databases and have this as a first attempt to open a data base
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
bool ok = db.open();
When I run this ok is always true, no matter what arguments are passed.
I would be grateful if someone could explain this
[edit: replaced inputs with something more generic SGaist]
sqlite is a file based database so you essentially give it the name of your database file and that's all. No credentials required by default.
You can even have your database completely in memory if needed.
But if I supply a non existent filename the call to open still succeeds and I do not understand why
A new database is created with that filename
So I will have to see if the file exists before opening it
Either that or have the database initialization code run using the "IF NOT EXIST" clause