Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PACK - Function is not supported on remote tables

Status
Not open for further replies.

TomLeMes

MIS
Mar 19, 2004
96
GB
Hi there, I'm not too sure about some of the terminology but will try to explain my situation. I'm using a SQL 2000 back end and use SQLEXEC to get data into VFP where it is bound to various controls. This works fine throughout my program.

In one module, I allow users to add multiple records to a cursor. They can then decide whether to save or discard the new records. If they decide to SAVE then the new records are added to the backend, again using SQLEXEC. The problem is that I also want them to be able to remove records locally and then choose to either commit or discard these changes in the same way. So the CLICK event of the Remove button says:
Code:
DELETE FROM myCursor WHERE pk = myPK
Which marks the record for deletion but doesn't actually get rid of it. I know that PACK would normally clear out such records, but when I try that it says: "Function is not supported on remote tables" - I'm guessing this is related to the fact that my data is coming from SQL using SPT? I have
Code:
SET DELETED ON
which means the deleted records are hidden, but RECCOUNT() still 'sees' them which is a real pain. For example, I have code that checks number of records - if > 1 then a dropdown is made visible, if = 1 then user sees only a label. Also, in the save routine my code loops through all the records in the cursor - do I have to put a clause to exclude deleted records in all such instances? Or is there a way of properly getting rid of these records?
 
OK, maybe I should have done some more digging! I see that
Code:
COUNT TO myVar
gives me a record count that ignores the deleted records... Looks like I'll be able to use that. Sorry!
 
If SET DELETED is OFF, COUNT will include the deleted records. Safer is:

COUNT FOR NOT DELETED() TO MyVar

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top