Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Check if it is a dbisam table
Mon, Jul 23 2007 9:25 AMPermanent Link

"Erik"
Hi,

I have a function to upgrade and to repair tabels.
I iterate by  FindFirst / FindNext a directory  :  findFirst(sMap+'\*.dat',
faAnyFile,SearchRec) ...  etc.

now, at one site there is a file with the name  VERSION.DAT , which is NOT a
dbisamtable and this file gives a dbisam-error 9217
is there a function to test if a file is a dbisamtable, so I can avoid this
type of errors ?

kind regards


Erik

Mon, Jul 23 2007 10:28 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Erik


The way I do it is either

1. Check for a .idx of the same name (.blb's may not exist but .idx's will)
2. Have a TDBISAMTable component, assign the name to it and call table.Exists

Roy Lambert
Mon, Jul 23 2007 10:37 AMPermanent Link

"Robert"

"Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message
news:ED78865D-3010-492F-AF46-65A1F4B4554A@news.elevatesoft.com...
> Erik
>
>
> The way I do it is either
>
> 1. Check for a .idx of the same name (.blb's may not exist but .idx's
> will)
> 2. Have a TDBISAMTable component, assign the name to it and call
> table.Exists
>

With DBISAM 4.25 the above is incorrect. Table.exists returns true if there
is a DAT file (any format) with the correct name.

I suspect the only way is to trap the error. There is no way (that I can
think of) where DBISAM would be able to distiguish a corrupted table file
from a non-table file with a DAT extension.

Robert

Mon, Jul 23 2007 2:41 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Erik,

<< is there a function to test if a file is a dbisamtable, so I can avoid
this type of errors ? >>

Assign the table name via the TDBISAMTable.TableName property and then check
the TDBISAMTable.VersionNum property inside of a try..except block.  If an
exception occurs or the VersionNum property is not '4.00', then it is not a
DBISAM 4 table.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Jul 24 2007 5:07 AMPermanent Link

"Erik"
Thanks !

Erik


"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> schreef in bericht
news:2BB77CD2-CAF4-4B59-BDAA-4EA4E2C347DD@news.elevatesoft.com...
> Erik,
>
> << is there a function to test if a file is a dbisamtable, so I can avoid
> this type of errors ? >>
>
> Assign the table name via the TDBISAMTable.TableName property and then
> check the TDBISAMTable.VersionNum property inside of a try..except block.
> If an exception occurs or the VersionNum property is not '4.00', then it
> is not a DBISAM 4 table.
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>

Image