Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy data from floppy to hard disk - what's wrong?
Message
From
24/01/2000 15:49:27
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00321783
Message ID:
00321808
Views:
15
>I'm trying to copy data from a floppy disk onto the hard drive. I know how to do this in DOS but am having trouble in VFP. I've attached the code. Right now it's duplicating everything on the C drive. My 3rd sele line that says sele document is where the problem is I think. How do I get VFP to know that document is the table on the floppy?
>

How about something like this - there are obvious flaws since you have no way of verifying that the info on the floppy is more correct than what's already present if the record already exists, but that's your issue:
USE A:DOCUMENT IN 0 ALIAS ADOC
SELECT * FROM ADOC ;
  INTO CURSOR NEWDOC ;
 WHERE dNumber NOT IN (SELECT dNumber FROM DOC) NOFILTER
SELECT doc
APPEND FROM DBF('NEWDOC')  && all new records added
SELECT * FROM ADOC ;
  INTO CURSOR UPDTDOC ;
 WHERE dNumber NOT IN (SELECT dNumber FROM NEWDOC) NOFILTER
SCAN
   SCATTER NAME loTemp && save record to object
   SELECT doc
   LOCATE FOR dNumber = UPDTDOC.dNumber && find match in doc
   GATHER NAME loTemp  and update from the object
   SELECT UPDTDOC
ENDSCAN
USE IN NEWDOC
USE IN UPDTDOC
USE IN ADOC
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform