Question : VFP, Append Grid data to a table

Working with VFP 9.0 SP2.  

I am working with a web store where I am downloading store orders.  I have a one-to-many relation. One order/customer info. to many items purchased.  I have a filtered the remote view  into a cursor of the items purchased, and have a grid populated from the cursor.   What is the best way to save the grid data, or cursor into a VFP table?   I'm not sure because it is the multiple records.

Thanks

Answer : VFP, Append Grid data to a table

Assuming you have a Grid Cursor (perhaps aliased as GridCursor)
And assuming that you want the data to go into MyTable which has the exact same field structure
And assuming that there is at least one field (DesirdFld) which can be used to differentiate empty records from non-empty records.....

IF !USED('MyTable')
  USE MyTable IN 0
ENDIF

SELECT MyTable
APPEND FROM DBF('GridCursor') FOR !EMPTY(DesirdFld)

NOTE - If the GridCursor and MyTable have different structures and/or need to be handled in some different manner (for example: say you want the Grid data into 2 separate VFP tables), then you will need to use another approach.   But you haven't told us enough to determine if that is necessary.

Good Luck
Random Solutions  
 
programming4us programming4us