Re: Binary Write to DBF file
- From: "Jim Mack" <jmack@xxxxxxxxxxxxxxx>
- Date: Tue, 3 Oct 2006 08:45:14 -0400
kohl.mike@xxxxxxxxx wrote:
Problem: Programmically changing the record count in a dbf file
No matter what I test, nothing seems to work. This is just an example
of what I want to do.
In the dbf header there are bytes that indicate how many recorrds are
in the dbf file. for example
record count: 255
How would I convert it to hex where my byte string would = "FF 00 00
00"
if my record count was 6,233 how would I convert that to a hex number
that is spread out into 4 byes?
Leaving aside the usefulness of what you propose, it's simple. The following is air code and does not reflect best practices:
Dim NumRecs&, NewNumRecs&, ValueLocation&
NewNumRecs& = 6233
ValueLocation& = 37 ' the 1-based file offset of your value
Open "whatever.dbf" for binary as #1
Get #1, ValueLocation&, NumRecs&
Put #1, ValueLocation&, NewNumRecs&
Close #1
--
Jim Mack
MicroDexterity Inc
www.microdexterity.com
.
- References:
- Binary Write to DBF file
- From: kohl . mike
- Binary Write to DBF file
- Prev by Date: Re: ANN:Just released "The Webmaster Collection"
- Next by Date: Re: How do i change numerics into binary numbers?
- Previous by thread: Binary Write to DBF file
- Next by thread: Re: Binary Write to DBF file
- Index(es):