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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT INTO CURSOR 2

Status
Not open for further replies.

itflash

Programmer
Jul 18, 2001
535
GB

Hi All

<VFP7 SP1>

I use CREATE CURSOR to create a cursor called tmp_one.

Then I do SELECT <whatever> INTO CURSOR tmp_one READWRITE.

Now, this overwrites my CREATE CURSOR command (settings are lost).

How can I do it so it Inserts into the cursor instead of overwriting and creating a new one?


Thanks
ITflash
 
itflash

When you create your second cursor, call it something else, and use APPEND FROM (between the two cursors) Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi,

I think you are talking about some Grid loosing its setup.

1. For the repeat select..

myGrid.RecordSource=''
Then I do SELECT <whatever> INTO CURSOR tmp_one READWRITE.
so that the same fields are again queried and a select is done. After the selection...
myGrid.RecordSource = &quot;tmp_one&quot;

2. Yet another method...

CREATE CURSOR to create a cursor called tmp_one.
Then I do SELECT <whatever> INTO CURSOR tmp_two
SELECT tmp_one
ZAP
APPEND FROM DBF('tmp_two')
USE IN tmp_two

It depends on the size of select you make.. Small SELECT cursors will not have any impact on the performance owing to multiple selects/appends used in above.

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
What settings are you referring to? There really are no 'settings' for a cursor. Do you mean for the grid?
If that is the case, remove the record source before running the query:

ThisForm.Grid1.RecordSource = ''
SELECT <whatever> INTO CURSOR tmp_one READWRITE
ThisForm.Grid1.RecordSource = tmp_one
Dave S.
[cheers]
 

Hi

Thanks for the replies.

Think Mike got it.

My cursor is like so:

CREATE CURSOR tmp_delitems ;
(delitemid n, poitemid n, qty i, delqty i, ;
partcode c(20), partname c(50), ;
delqty1 i DEFAULT 0 CHECK (delqty1>-1)
ERROR &quot;Qty Cannot be Negatitve&quot;)

So I have error checking on it.

I'll try it now.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top