Page 1 of 1

How can I tell if Database to exist?

Posted: Thu 22 Jan 2015 03:56
by ibdac1pro
How can I tell if Database to exist?

for example
if UniConnect1.ExistsDataBase('MyDBName') then
DB creattion..
else
DB Open...

Unidac 6.02

Re: How can I tell if Database to exist?

Posted: Thu 22 Jan 2015 07:30
by AlexP
Hello,

Please specify the name of the DB you are using.

Re: How can I tell if Database to exist?

Posted: Fri 23 Jan 2015 05:55
by ibdac1pro
Sqlite for Android(embedded).

Re: How can I tell if Database to exist?

Posted: Fri 23 Jan 2015 08:15
by AlexP
To implement such behavior, you should set the ForceCreateDatabase option to True. In this case, if a database doesn't exist, it will be created automatically. Otherwise, the existing database will be opened.

Code: Select all

UniConnetion.SpecificOptions.Values['ForceCreateDatabase'] := 'True';
P.S. Since SQLite is a file database, then for check it is enough to ensure file existence.

Re: How can I tell if Database to exist?

Posted: Sat 24 Jan 2015 02:44
by ibdac1pro
Hi,

OK. Thanks a lot.

Re: How can I tell if Database to exist?

Posted: Mon 26 Jan 2015 07:36
by AlexP
If you have any further questions, feel free to contact us.