Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 4 of 4 total |
How to trap a database connection error? |
Sat, Oct 14 2006 6:31 PM | Permanent Link |
"Marcio Ehrlich" | Is there a way to trap a connection error, as in the event of an inexistent
directory or a directory with no dat file at all? I have tried this but the control never passed to the except section: With DBISAMDatabase1 do begin Connected := False; Directory := 'D:\CRAP'; try Connected := True; except ShowMessage('Error'); end; end; Thanks, Marcio |
Sun, Oct 15 2006 12:49 AM | Permanent Link |
"Robert" | "Marcio Ehrlich" <marcioehrlich_at_ig.com.br> wrote in message news:508BF761-0E3B-4FD6-8633-09810387DB12@news.elevatesoft.com... > Is there a way to trap a connection error, as in the event of an > inexistent > directory or a directory with no dat file at all? I look for a table that I know has to be there, before I even try to connect the database. If D:\crap\mytable.dat is not there, bye bye. Robert |
Sun, Oct 15 2006 1:22 PM | Permanent Link |
Sanford Aranoff | if not DirectoryExists('crap') then
write_err('Directory ' + 'crap' + ' does not exit') else Marcio Ehrlich wrote: > Is there a way to trap a connection error, as in the event of an inexistent > directory or a directory with no dat file at all? |
Mon, Oct 16 2006 3:07 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Marcio,
<< Is there a way to trap a connection error, as in the event of an inexistent directory or a directory with no dat file at all? I have tried this but the control never passed to the except section: >> DBISAM doesn't check the existence of the directory until it tries to open a table in that directory. I would recommend that you check the directory with DirectoryExists() if you want to verify its existence. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |