Re: Binary Write to DBF file
- From: kohl.mike@xxxxxxxxx
- Date: 3 Oct 2006 19:44:14 -0700
Thanks for the information.
Cindy Winegarden wrote:
Hi Mike,
By "remove" do you mean "delete?" In DBFs rows that are deleted are still in
the table but are marked for deletion and are filtered out by the Fox data
engine unless you issue Set Deleted Off and subsequently can see and recall
deleted records. The records aren't physically removed from the table until
the Pack command is issued and this requires exclusive use of the table(s).
I'm sure that's what you're running into.
If you try to adjust the header to agree with the number of non-deleted rows
then you will effectively corrupt the table and make it unusable to any
other DBF compatible software such as VFP OLE DB or ODBC, Excel or Access
(if it uses the older DBase IV format), etc.
I suggest you spend a lot of time learning about how DBFs really work, or,
for a better use of your time, spend time optimizing your code and the table
indexes. A really important factor in DBF access speed is having indexes on
the tables whose expressions exactly match the expressions in your Join and
Where clauses. When retrieving data the DBF data engine reads the index
files and then retrieves only those rows it needs based on the index values,
and then sorts out locally whatever's left. Example - Have an index on
LastName. Select ... Where LastName = "Smith" and FirstName = "Mike". The
data engine reads the binarry tree index and finds out where the Smiths are.
The Smith records are brought across the wire and then the rows for "Mike"
are sorted out locally.
You can read more about indexing in various places, among them is
http://fox.wikis.com.
--
Cindy Winegarden MCSD, Microsoft Most Valuable Professional
cindy@xxxxxxxxxxxxxxxxxxx
<kohl.mike@xxxxxxxxx> wrote in message
news:1159919513.075011.101820@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Well, basically what I am trying to do is to create a dbf writer using
vb.net. I'm searching for a solution to quickly create, and write to a
dbf file. Since, I am just learning this I am not sure what is the
best practice. Edit an existing dbf, or creat one from scratch. So, I
am testing a few things and listening to the advice I receive from all
of you.
I'm currently using ado.net to connect to a dbf and process files using
sql statements, however everything I have tried is kind of slow, so I
want to dig a little deeper, and see if I can process files quicker
using FileStream, binarywriter, and binaryreader.
Its kind of hard to explain one of my current issues but after removing
records from a dbf file, the software we use to open them doesnt give a
true record count. I'm not sure if this has something to do with the
index file or what.
.
- Follow-Ups:
- Re: Binary Write to DBF file
- From: Ralph
- Re: Binary Write to DBF file
- References:
- Binary Write to DBF file
- From: kohl . mike
- Re: Binary Write to DBF file
- From: Cindy Winegarden
- Re: Binary Write to DBF file
- From: kohl . mike
- Re: Binary Write to DBF file
- From: Cindy Winegarden
- Binary Write to DBF file
- Prev by Date: Re: Binary Write to DBF file
- Next by Date: Re: How do i change numerics into binary numbers?
- Previous by thread: Re: Binary Write to DBF file
- Next by thread: Re: Binary Write to DBF file
- Index(es):
Relevant Pages
|