I would like to insert into a table every file in a directory. With GETFILE() I can see them. But, What code should I use to append them to a table?
Victor F. Rodriguez
SET DEFA TO C:\MyDirectory
gnDbcnumber = ADIR(gaDatabase, '*.*') && Create array
FOR nCount = 1 TO gnDbcnumber && Loop for number of files
lcFile = gaDatabase(nCount,1)
SELECT myTable
APPEND BLANK
REPLACE myTable.filename with lcFile
ENDFOR
You can play with the code. I usually prefer insert over append but append is nice for demo purposes.
Thanks for your prompt answer. I am trying to put it into practice and have encountered another inconvenience. I am using VFP5 and tried to locate the DEFAULT DIRECTORY WITH
cDefault = GETDIR()
But when I
SET DEFAULT TO cDefault
an invalid error occurs.
The default directory is very hard to find and it is written with long file names... like this
C:\Documents and settings\all users\Documents\My faxes\Sent Faxes
Any solution...?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.