Home > Archive > dBASE Knowledge Base > June 2005 > database engine error: corrupt file - other than header









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author database engine error: corrupt file - other than header
IWriteCode

2005-06-15, 3:23 am

I just purchase dBase 2.5 for the sole purpose of creating table structures and importing text files into them and then exporting them in various other formats. To test dBASe, I created a table in Design view with the same Specs as one i built in Access
and then used the APPEND FROM *.CSV DELIMITED and immediately get the error 'Database Engine Error: Corrupt file - other than header'. I know there is nothing wrong with the CSV file as I have previously imported it to Access.
Anybody got any ideas.
Eric Logan

2005-06-15, 11:23 am

1) By '*.CSV' you mean the actual name of the text file, right?
2) For dBase to import text files, the line terminators should be
carriage-return + linefeed: chr(13)+chr(10). Is it possible that your lines
are terminated only by chr(13), or by chr(10), or by some other
character(s)? I think that trying to import non-CR-LF-terminated text files
is a common cause of the error message you got.
E.L.

"IWriteCode" wrote ...
I created a table in Design view with the same Specs as one i built in
Access and then used the APPEND FROM *.CSV DELIMITED and immediately get the
error 'Database Engine Error: Corrupt file - other than header'. I know
there is nothing wrong with the CSV file as I have previously imported it to
Access.



IWriteCode

2005-06-15, 1:23 pm

Eric Logan Wrote:

> 1) By '*.CSV' you mean the actual name of the text file, right?
> 2) For dBase to import text files, the line terminators should be
> carriage-return + linefeed: chr(13)+chr(10). Is it possible that your lines
> are terminated only by chr(13), or by chr(10), or by some other
> character(s)? I think that trying to import non-CR-LF-terminated text files
> is a common cause of the error message you got.
> E.L.
>
> "IWriteCode" wrote ...
> I created a table in Design view with the same Specs as one i built in
> Access and then used the APPEND FROM *.CSV DELIMITED and immediately get the
> error 'Database Engine Error: Corrupt file - other than header'. I know
> there is nothing wrong with the CSV file as I have previously imported it to
> Access.
>
>
>

Thanks for the help but this is a Comma delimited file, thus the CSV extension. It is not corrupt and it is built correctly without a header.
Thanks again for the response
Bruce Beacham

2005-06-15, 8:23 pm

> Thanks for the help but this is a Comma delimited file, thus the CSV extension.

He aimed to check you specified an actual file name, not a * (with the
apt suffix).

> It is not corrupt and it is built correctly without a header.
> Thanks again for the response


How about posting up a short segment of the file? Perhaps zipped, to
maintain its integrity.


Bruce Beacham
IWriteCode

2005-06-15, 8:23 pm

Bruce Beacham Wrote:

>
> He aimed to check you specified an actual file name, not a * (with the
> apt suffix).
>
>
> How about posting up a short segment of the file? Perhaps zipped, to
> maintain its integrity.
>
>
> Bruce Beacham


IWriteCode

2005-06-15, 8:23 pm

IWriteCode Wrote:

> Bruce Beacham Wrote:
>
>


Thanks but it is 224000 record database of person information and my client would not appreciate me breeching his trust not to speeak of legal implications involving even a single name.

I'm suspecting this is a configuration issue as I'm also getting a BDE engine version error inspite of installing the latest and greatest.
Bruce Beacham

2005-06-16, 11:23 am

IWriteCode wrote:
> I'm suspecting this is a configuration issue as I'm also getting a
> BDE engine version error inspite of installing the latest and
> greatest.


OK, then it's back in your court.

Perhaps you'd be better posting in d.programming next time.


Bruce
Eric Logan

2005-06-16, 11:23 am


> "IWriteCode" wrote ...
extension.[color=darkred]
> Thanks but it is 224000 record database of person information and my

client would not appreciate me breeching his trust not to speeak of legal
implications involving even a single name.
> I'm suspecting this is a configuration issue as I'm also getting a BDE

engine version error inspite of installing the latest and greatest.

Why not start with the basics. Find out for sure what kind of file you have.
Try the code below.
E.L.

// determining if text file has standard line terminators: chr(13)+chr(10)

// open your file in a file object

f = new file()
f.open('YourTextFile.csv')

// read to first CR LF in first million characters.

mstr = f.gets(1000000, chr(13)+chr(10))

// How long is the string? (Is it your whole file?)

? len(mstr)

// Are you at the end of your file?

?f.eof()

// Maybe repeat the above a few times.
// go back to the beginning of file

f.seek(0)

// read to first LF in first million characters.

mstr = f.gets(1000000, chr(10))

// What is the previous character? Is it chr(13)?
// If not 13, your file doesn't have standard line terminators.

?asc(right(mstr,1))

f.close()


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com