?
Solved

Database exist check

Posted on 2006-11-20
5
Medium Priority
?
403 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 500 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 500 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 500 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 500 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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month10 days, 16 hours left to enroll

770 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