Solved

Database exist check

Posted on 2006-11-20
5
401 Views
Last Modified: 2010-04-05
Hi Experts,

I can create and open database. But how can I check whether the database to open exists or not? I use D7 and InterBase.

Thanks

Janos
0
Comment
Question by:kacor
5 Comments
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 125 total points
ID: 17983430
I think you will have to try to connect and catch the exception.
If you have network access rights you could just check if the database file exists first, but this is unlikely in a well setup database/network environment
0
 
LVL 15

Assisted Solution

by:mikelittlewood
mikelittlewood earned 125 total points
ID: 17983494
I agree with Loki, you would probably be better trying to open the connection and wrap it in a try except end when your application starts up.

0
 
LVL 9

Assisted Solution

by:sun4sunday
sun4sunday earned 125 total points
ID: 17984891
In the try catch open a table in the database. If the table cannot connect that means there is no connection. The better way is to use a query component to connect it to the database with a simple select.

sun4sunday


0
 
LVL 10

Assisted Solution

by:atul_parmar
atul_parmar earned 125 total points
ID: 17985502
In InterBase you need to specify a database name (a .gdb file); you can simply check whether the file exist or not by using FileExists funtion.
0
 
LVL 10

Author Comment

by:kacor
ID: 18249543
Hello guys,

sorry for my late answer. Unfortunately I had serious problems with my PC and I can't continue this project because of other problems. Thank you for supporting me and I wish you happy new year!

Janos
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question