Solved

Database exist check

Posted on 2006-11-20
5
398 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:János Szabó
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:János Szabó
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to convert wav to mp3 in delphi 9 200
Printing problem 2 94
Delphi selector screen 2 79
Tviruailstringtree sort multi columns on header click 1 63
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…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 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