Solved

Database exist check

Posted on 2006-11-20
5
396 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now