Application path did not work!
-
What output do you get if you change your code to:
@
QSqlDatabase mydb = QSqlDatabase::addDatabase("QSQLITE");
QString databasePath = QCoreApplication::applicationDirPath() + "/data/27115";
qDebug() << "database location:" << databasePath;
mydb.setDatabaseName(databasePath);
mydb.open();
if (mydb.open())
{
goview();
}
mydb.close();
}
@Please also tell us what output you expected there.
-
[quote author="Andre" date="1327922300"]What output do you get if you change your code to:
@
QSqlDatabase mydb = QSqlDatabase::addDatabase("QSQLITE");
QString databasePath = QCoreApplication::applicationDirPath() + "/data/27115";
qDebug() << "database location:" << databasePath;
mydb.setDatabaseName(databasePath);
mydb.open();
if (mydb.open())
{
goview();
}
mydb.close();
}
@Please also tell us what output you expected there.[/quote]
the output is : @
database location:C:/Users/MR.Farahmand/Desktop/parsipedia-001-beta-build-desktop/debug/data/27115
@
the database address is true but....!! -
Can you please write complete sentences? And can you please stop filling in nonsense like "you know" - no, we don't. None of us has a crystal ball here and none of us knows what you're doing and what you're expecting.
There is nothing like "database address is true" - that's a nonsens statement. We're talking about a path here. That can be valid or not. It can exist or not. But it can neither be true nor false. A bit more precision, please.
Do you work with an existing database or do you create it at runtime?
For the former:
Does that path exist?
Is it really a file and not a directory?
Can your read it?
Is it an sqlite database file?For the latter:
Does your data subdirectory exist?
If not: create it! Sqlite will not do this for you! -
Hi to all
I'm so sorry for times that you used for this post
that's problem was not for db file path
web must copy sqldrivers folder to output folder (debug folder neer exe file).
[quote author="Seba84" date="1328030127"]I don't believe what I see. This post is useless and it was
a waste of time for all who participated...Seba84[/quote]
any post can't be useless!!
maybe some people have this problem exactly !thanks all
-
[quote author="abbas farahmand" date="1328272043"]
maybe some people have this problem exactly![/quote]Well, you never posted a solution.
You described your problem, we plead for additional information and then
[quote author="abbas farahmand" date="1328272043"]
I fixed it with other ways.
[/quote]So if you want this thread to have any valuable information for others you better hand in what actually solved your problem - what you now did.