SQlite Db open more than one
-
@gfxx said in SQlite Db open more than one:
so actually I have 2 /home/.mypath/db2.sqlite3
How should that be possible? You can't have two files with exact same name in exact same folder. Can you please show us the exact file names and locations? (like ls -lh in the folder where these files are)?
Does you database really contain a table with that name? -
@gfxx
No operating system permits two identically named files in the same directory. Please go and deal with this yourself, it's neither a Qt problem nor one other people can help you with.same name (can not show it sorry).
Looks from the shot that the names are not the same, in the area you have scrubbed out. So that's for you to address.
-
@JonB Sorry but not agree .... if cancel that file .... and after QT5 app write that error think Qt is problem not SO. But these SO is Ubuntu 20.04 not a perfect example of integrity .... but I think problem was QT/Sqlite related. If try to rename it SO advise me that other file with same name exist .... so SO do the right work .... problem was: Why app write a new db file if no one command these????
-
@gfxx In the picture I saw the actual file name was hidden. That 0b file could be a lock file generated by SQLite while the DB is open. That is also why it disappears when the DB is not open anymore. So, ignore that file and consentrate on the actual DB file. I repeat my question: does your database contain a table named Table1? This is the question you should answer first before you care about other files...
-
@gfxx said in SQlite Db open more than one:
Why app write a new db file if no one command these????
As I wrote above: that is probably a temporary file created by SQLite when you open a DB...
-
@gfxx said in SQlite Db open more than one:
Sorry but not agree ....
You are incorrect, whether you agree or not. Nothing to do with Qt. since the OS does not support identically named files in the same directory you might sit and think about what you claiming. By my eye judgement, I would say the second one (non-0-length) is 1 character longer. Maybe it's a space....
If you scrub names out nobody here can help you. If you had done @jsulm's
ls -lh
you would know by now, or ask a colleague to look at it for you. -
@jsulm said in SQlite Db open more than one:
I repeat my question: does your database contain a table named Table1?
these is the problem Table1 exist .... because I know can be tired ... I open SQlite db browser -> modify table -> at that point I copy the table name and paste it on QT app code .... the same with db name and path using terminal .... so can not make disctraction error ....
-
@JonB real sorry .... you are in right ..... sorry at all .... using ls on folder I discover that for some reasons db2 path have a "spaces" before .sqlite3 ..... not see at all and all my code is write whithout spaces ... maybe i insert spaces for distractions last time I've copied db name path ....
-
@gfxx
:) Which is what I suggested! :) One just has to be logical about these things. A GUI dialog like you show with proportional fonts for names is not great to spot this! That's whyls -lh
is a good idea :) Anyway rename the "proper" database file to remove the spaces and then see how you go.