Solved Database Connect Problem, Out Of Memory
-
@SGaist
No -
Nor a new base allows. Now I tried to upload the XML file QFile and not uploaded.
-
Please post the exact error you are getting. Just saying it doesn't work doesn't help to diagnose what happens on your machine.
QFile also provides an error function for that. -
@SGaist said in Database Connect Problem, Out Of Memory:
Please post the exact error you are getting. Just saying it doesn't work doesn't help to diagnose what happens on your machine.
QFile also provides an error function for that.db = QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName("C:/Users/tleladze/Desktop/temp/dbbb.sqlite"); if(db.open()){ qDebug() << "db opened"; } else qDebug() << db.lastError(); QString paths = "C:/Users/tleladze/Desktop/queryxml.xml"; QFile* file = new QFile(paths); if(!file->open(QIODevice::ReadOnly)){ qDebug() << "Filed To Open: " << file->errorString(); }
debug:
QSqlError("-1", "Error opening database", "out of memory")
Filed To Open: "The filename, directory name, or volume label syntax is incorrect." -
Again, do you have any strange characters in your paths ? Anything non-ASCII ?
-
@SGaist said in Database Connect Problem, Out Of Memory:
Again, do you have any strange characters in your paths ? Anything non-ASCII ?
Just to make sure, right click your .cpp file, open with->notepad->file->save as->select the encoding to be ANSI. if notepad complains about unicode chars then old Samuel was correct (as is often the case). click ok, overwrite the old .cpp file and try again
-
@VRonin
hah.. its worked :D thank youuu VRONIN!!! and all :))
So the problem was UTF? -
@VRonin
When I saved the file ASCI, QT added to the address of "?" Delete these characters and everything is settled.
"?C:/Users/tleladze/Desktop/temp/dbbb.sqlite" -
@Taz742 said in Database Connect Problem, Out Of Memory:
So the problem was UTF?
Not really, UTF in general is fine for modern compilers, the problem was that you had a Left-To-Right Embedding character before C: that messed up the validity of your path
-
@VRonin
I can not understand what it means to UTF-8, ASCI, and so on. But thanks for the detailed answer. -
@Taz742 said in Database Connect Problem, Out Of Memory:
@VRonin
I can not understand what it means to UTF-8, ASCI, and so on. But thanks for the detailed answer.Pls take your time and read through this:
-
@J.Hilk
The problem is that I do not know English and other foreign languages. My country's language is very little information on the Internet and in books. google translate the language of my country will not translate well. I have read this post ever. thanks. -
@Taz742
Well I assume the last answer is reversed google translate so it is easy to imagine how strange most docs
will become :)