Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 408
  • Last Modified:

Database exist check

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
kacor
Asked:
kacor
4 Solutions
 
TheRealLokiSenior DeveloperCommented:
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
 
mikelittlewoodCommented:
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
 
sun4sundayCommented:
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
 
atul_parmarCommented:
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
 
kacorretiredAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now