By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,495 Members | 1,320 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,495 IT Pros & Developers. It's quick & easy.

DBF FILE STRUCTURE

P: n/a
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!
Dec 5 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a


"JimmyKoolPantz" wrote:
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?


Dec 5 '07 #2

P: n/a
On Dec 4, 8:46 pm, Family Tree Mike
<FamilyTreeM...@discussions.microsoft.comwrote:
"JimmyKoolPantz" wrote:
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 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.
Dec 5 '07 #3

P: n/a
Try using Advantage .NET Data Provider 8.1 you can found it on
www.advantagedatabase.com under downloads section
On Tue, 4 Dec 2007 17:06:03 -0800 (PST), JimmyKoolPantz
<ko*******@gmail.comwrote:
>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!
Dec 5 '07 #4

P: n/a
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.
Dec 5 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.