Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleted records and a scrollbar
Message
From
03/06/2005 11:18:08
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01019811
Message ID:
01019920
Views:
21
Hey Nadia, YOU CAN select from Mycursor into Mycursor, i do that often and did it just now to check if I was making the " usual mistake " :-)
try and youl'' see it works.
You cannot do that if you select from a table into the same table but I was talking about cursors...

>You can not select from myCursor into cursor myCursor.
>
>So I selected to a temp table, zap the original and insert from this. Here is the exact code, if you're curious:
>
>
>*---------------------- Location Section ------------------------
>*   Library: 	Aqueuesbiz.vcx
>*   Class: 		Investigatorqueuelookup
>*   Method: 	Deleterecord()
>*----------------------- Usage Section --------------------------
>*)  Description: Deletes a record from the cursor
>*)
>
>*   Scope:      Public
>*   Parameters:
>*$  Usage:
>*$
>*   Returns:
>*--------------------- Maintenance Section ----------------------
>*   Change Log:
>*       CREATED 	03/09/2004 - JMW
>*		MODIFIED
>*----------------------------------------------------------------
>lparameters tcTrans_pk
>
>if seek(m.tcTrans_pk, 'v_InvestigatorQueue', 'cTrans_pk')
>	delete in v_InvestigatorQueue
>	this.lDeleted = .t.
>	SELECT * from v_InvestigatorQueue INTO CURSOR curTemp nofilter
>	ZAP IN v_InvestigatorQueue
>	INSERT INTO v_InvestigatorQueue SELECT * from curTemp
>	USE IN curTemp
>endif
>
>go top in v_InvestigatorQueue
>
>return this.lDeleted
>
>
>>what about run again a select sql over the cursor (readwrite) just after the user delete a record ? You could use the same cursor name as query result and the only thing you should do is to redefine the grid controlsource....
>>>>>Hi everybody,
>>>>>
>>>>>If I delete records from the cursor which is source for the grid, the scrollbar now has a gap and could not be put at the top. Is there a way to fix this behavior or there is no way (as I found with filters)...
>>>>>
>>>>>What should I answer to the user who noticed this problem?
>>>>
>>>>Instead of using a filter, you can use a view. Using a filter on a Grid is slow, anyway. I heard rumors that this was improved in VFP 9, but I am not sure how trustworthy this is.
>>>>
>>>>A view will show you only the relevant records.
>>>>
>>>>If a user deletes a record in the view, you would probably still see the gap, until the next time the view is refreshed.
>>>
>>>My idea of selecting records to a temp file and inserting them back works quite nicely...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform