> On Feb 4, 2015, at 7:51 AM, Graham Labdon <graham.lab...@avalonsciences.com> > wrote: > > Hi > 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"); > db.setHostName("bigblue"); > db.setDatabaseName("flightdb"); > db.setUserName("acarlson"); > db.setPassword("1uTbSbAs"); > 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 > > Thanks >
Sqlite has no notion of a user name or password. If you pass a nonexistent database, sqlite will create it. I would think the only way QSqlDatabase::open() would return a false would be if the file could not be written; i.e. no read and write privileges for the user running the program. Karl _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest