Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with grid control when using a temp CURSOR

0 views
Skip to first unread message

Brian Stegeman

unread,
Nov 17, 2004, 11:09:58 PM11/17/04
to
Having difficulting using a grid that is linked to a temporary CURSOR
created with CREATE CURSOR. Don't have problems if I link to an actual
database but can't see anything in the CURSOR even though I can BROWSE it.
Is there some trick to getting this to work? I'm running VFP 7.0. I've
seen other posts that seem to say that this should work, but all I ever see
when I run the form is an empty, lifeless grid.

Thanks,
Brian


Jack Jackson

unread,
Nov 17, 2004, 11:37:18 PM11/17/04
to

What is wrong? "empty, lifeless grid" is not very descriptive.

You will have problems if you re-create the cursor while it is tied to
the grid. If you need to do that, set the grid's RecordSource to ''
before re-creating the cursor then set it again.

Also, after inserting records into the grid move the record pointer to
the top and call grid.Refresh(). If the record pointer is at the end
of the cursor you may not see any records in the grid.


Bill Browne

unread,
Nov 18, 2004, 12:07:48 AM11/18/04
to
In addition to what Jack said, I've had this problem, as recently as today:

When using cursors, make sure your RecordSourceType property is set to Alias
and not Table.

--
Bill Browne
www.edgefinderstudios.com


"Jack Jackson" <jackn...@pebbleridge.com> wrote in message
news:6g9op0t47ph3878pg...@4ax.com...

Altman

unread,
Nov 18, 2004, 9:55:53 AM11/18/04
to
Make sure you set the recordsource of the grid to the cursor and use quotes.
mygrid.recordsource = "myCursor"
Also set your column controlsource to the field
myGrid.column1.controlsource = "MyCursor.Field1"
And as stated before set the recordsourcetype of the grid to alias.

"Brian Stegeman" <brian.s...@midmomicro.com> wrote in message
news:uM327OSz...@TK2MSFTNGP14.phx.gbl...

Brian Stegeman

unread,
Nov 18, 2004, 12:32:04 PM11/18/04
to
Thank you very much, the problem was with the order I created the CURSOR and
the grid. Thought everything was in order but when I set the inital to ""
and setup a button to set the recordsource and refresh it worked like I
thought it should. All makes sense now... (banging head on desk)

"Jack Jackson" <jackn...@pebbleridge.com> wrote in message
news:6g9op0t47ph3878pg...@4ax.com...

0 new messages