Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Database exist check

Posted on 2006-11-20
5
Medium Priority
?
404 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

597 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