> are you using APPEND
> FROM to post to the vfp dbf file? I want to move a text file (using a low
> level file
> functions) to a vfp dbf file. Could you show me some code?..thanks
> again..rob
Using Append From is much, much faster, only if it's possible :)
That is if the text file is falling into some of available formats (SDF,
tab delimited, comma delimited, anything delimited). Doing it with LL
functions is a bit of a PITA but is mostly unavoidable if you have to
deal with foreign data formats. I used that approach for converting MBP
(and other) Cobol data, even when the original table was fixed-length
and cr-ended (that is, SDF) because some of the fields contained null
bytes, in which case the columns to the right were read as blanks, no
matter if only one was blank.
The general approach is to read a portion of a source file into a string
buffer (recognizing the EOL is a story for itself, and won't work if the
line contains nulls), then chopping the string into substrings,
converting the cutouts to proper data types (like converting as mmddyy
string into a date variable, or storing a val(chop)/100 into a
m.numeric_var), and then Insert Into DestTable From Memvar, and so on
While Not Feof(source_handle), and =fclose(source_handle) after that.
The best part of the story depends on the data you are reading - what
were they written with, what's the format, what's the delimiters and so
on. It may be a good experience to do it once in a while, but I strongly
recommend to Append From, if possible.