DBF FILE STRUCTURE

J

JimmyKoolPantz

IDE: VB2005
FILE TYPE: DBF5

I appoligize if I am posting in the wrong group.

Question: Is there a position in the dbf file structure that will
allow me to delete a field, such as, the way the dbf file structure
has a record deletion flag? I have wrote a class for reading and
writing dbf files but I recently came across the need to delete fields
quickly. I'm currently reading the records into a dataset and then
writing them to a dbf file but, looking for a quicker solution. What
I thought was possible appears not to be, I wanted to copy the dbf
file, rename it, and then update a field deletion flag, and then pack
it.

The utility I am writing allows the users to select the fields they
want to keep, then my utility creates a script of only the fields they
have selected.

Any suggestions would greatly be appreciated.

Thanks!
 
F

Family Tree Mike

JimmyKoolPantz said:
IDE: VB2005
FILE TYPE: DBF5

I appoligize if I am posting in the wrong group.

Question: Is there a position in the dbf file structure that will
allow me to delete a field, such as, the way the dbf file structure
has a record deletion flag? I have wrote a class for reading and
writing dbf files but I recently came across the need to delete fields
quickly. I'm currently reading the records into a dataset and then
writing them to a dbf file but, looking for a quicker solution. What
I thought was possible appears not to be, I wanted to copy the dbf
file, rename it, and then update a field deletion flag, and then pack
it.

The utility I am writing allows the users to select the fields they
want to keep, then my utility creates a script of only the fields they
have selected.

Any suggestions would greatly be appreciated.

Thanks!

Do you mean you are directly reading and writting bytes of the .dbf
formatted file? This post brings back bad memories! A good source of info
on this is http://www.wotsit.org/. It does not look like marking a field
similar to rows as deleted exists.

Why not use the OleDbConnection and associated classes?
 
J

JimmyKoolPantz

Do you mean you are directly reading and writting bytes of the .dbf
formatted file? This post brings back bad memories! A good source of info
on this ishttp://www.wotsit.org/. It does not look like marking a field
similar to rows as deleted exists.

Why not use the OleDbConnection and associated classes?- Hide quoted text -

- Show quoted text -

Yes, I am reading and writing the bytes, which is no longer an issue
(brings back bad memories to me also) I'm just searching for the
fastest way regenerate a dbf that only has the fields that the user
selects. I like the speed of reading and writing in bytes and was
hoping I could remove fields in a similiar way I remove records. We
deal with files that have many fields an many records, so speed is
currently the issue. The function I have now works but not so good
with large files an was hoping I could find an alternitive way to do
than read it, store it in a dataset and then write it back out ot a
dbf. I might just have to reavaluate my code to see where its taking
the longest to process. Thanks for your response.
 
J

JimmyKoolPantz

I think I might try and query the dbf file to remove the fields. This
was not an option when creating the reader and writer because of the
sluggish results. But, it might work in this case, because all I want
to do is alter the table fields.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top