Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using dBase IV .DBF's
Message
From
17/11/1998 10:32:01
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00158193
Message ID:
00158228
Views:
12
>I am trying to automate the import of data that is given to me periodically in dBase IV format. Actually it is produced by Codebase. The problem is that I am only receiving the .DBF file and I am not being given the associated .MDX file (the dBase way of doing .CDX files).
>
>When opening a Fox DBF that is missing a CDX, I can just set SAFETY OFF and go ahead, however, I believe Fox is trying to convert the non-existant MDX into a CDX and therefore I get error 1707 (non existant CDX) that I can't get around in code!
>
>If i do this interactively, I get the usual dialog box to ignore/cancel where I can severe any MDX/CDX requirement, but what can I do in code?
>
>
>Thanx
Like in Fox header (byte offset 28) in dBaseIV table there should be a flag indicating it has an MDX file. First I would just try to turn off bit 0 of byte 28 in header.
handle=fopen("db4.dbf",12)
=fseek(handle,28)
nCurByte=fread(handle,1)
=fseek(handle,28)
=fwrite(handle,chr(bitand(asc(nCurByte),0xFE)))
=fclose(handle)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform