Im new to foxpro and its work areas are something i dont really dont get so that`s likely where the problem is.
Basically i have a form that takes 2 .csv files and puts them into foxpro tables.
I get a run time error at the last line of this, can anyone see the problem?
web_file = Thisform.mcFile
web_file2 = thisform.mcfile2
web_letter = Thisform.mcLetter
web_gl = Thisform.mcGl
web_gl2 = Thisform.mcGl2
Set Date To Dmy
Close Data
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
mcFile = Thisform.mcFile
mcFile2 = Thisform.mcFile2
Wait Clear
If File("web_temp.dbf")
Delete File web_temp.Dbf
Endif
Create Table web_temp (;
email1 C(40),;
opentime1 C(40),;
o2idnumb1 C(10))
Use
Select 0
USE web_temp Exclusive
Append From &web_file Delim
If File("web_temp2.dbf")
Delete File web_temp2.Dbf
Endif
Create Table web_temp2 (;
email C(40),;
opentime C(40),;
o2idnumb C(10))
Use
Select 0
USE web_temp2 Exclusive
APPEND FROM &web_file2 Delim
Also, im not the original author, im the maintenance guy. so if things look weird its because ive been using his code without really understanding it.
Yup, looks like very old code but let me try to help you understand what is going on…
Now, all that said, here is some super shortcuts for you, especially if these are in fact temporary tables that you would otherwise be “discarding” when finished…
*/ The above doesn’t confirm expected files exist, so I would pre-check
If you have a file that is underlying as hex values, they’ll just be pulled-in verbatim as would be seen in a notepad editor. (or via MODIFY COMMAND NameOfTheFile) from within VFP