Mount Power
 
Picture

Pokrewne:

Cytat:

Database is already opened when open 2 DB files





pcam - Nie Lis 11, 2007 5:41 pm
" />I suppose this may be a feature, but if you try to open 2 databases files from 2 diffrent directories with the same name and same schema, you get "<DBName> is already opened"

It is quite convenient to let users open databse with same name but residing in different locations. So I suppose this qualifies as a bug.

I guess what is needed is to compare the path as well as the filename to know if the DB should or not be opened and added to the treeview.




Googie - Pon Lis 12, 2007 8:05 pm
" />How did you add two databases with same name to the list? There is protection against situations like this. You should not be able to add second database with the same name. If you try, I'll get dialog window with message like: "Given database name is already on the list."

You can't use two databases with same name on the list. It's a rule (why would you use same names? it would be confusing).



Wiaz - Wto Lis 13, 2007 5:48 am
" />You're wrong Googie!
you can open even the same database (not with the same name) but with another alias. You can even attach the same database to the same database!
Sometimies it is simplier to do some querries if i have attached the same database! and it is possible with sqlite and i think with sql databases!
You do have aliases of database files:
ATTACH [DATABASE] database-filename AS database-name
Of course in your application you should prevent to open the same database file (but not file with the same name but different folder!)
but you must allow attach the same database!
best regards!

P.S.
from sqlite.org attach description:
....
You cannot create a new table with the same name as a table in an attached database, but you can attach a database which contains tables whose names are duplicates of tables in the main database. It is also permissible to attach the same database file multiple times.
....



Googie - Wto Lis 13, 2007 7:48 am
" />I am not wrong. I've tried it before I wrote the post above.
I'm not saying that SQLite has such protection, but SQLiteStudio will deny to add second database with same name/alias on the list.

Anyway, you're right about opening same database file.

Regarding "ATTACH" and "DETACH", I missed them. It's a shame on me, but I'll add them in version 1.1, since they are not significant features. Now I just want to make application stable.
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • przeloty.htw.pl