Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Andy Kramek
  Where is Andy Kramek?
 Hot Springs Village
 Arkansas - United States
 Andy Kramek
 To: Rob Vleeschhouwer
  Where is Rob Vleeschhouwer?
 Leeuwarden
 Netherlands
 Rob Vleeschhouwer
 Tags
Subject: RE: select readonly.
Thread ID: 143288 Message ID: 143633 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, August 30, 2007 1:11:36 PM         
   


Rob

> After all it is better to do:
> select * from orderline into table ordergrid where {condition],
> because I have to use a few valids.
>
> I have a form with a grid. In the init in that form I have 'select...............'
> The recordsource of the grid is ordergrid, recordsourcetype 1.
> But ordergrid will not appear in the grid. How can I get the results of the query
> in the grid. And what is the right place for 'Buffering=.....'
> I have tried all other options recordsourcetype. No result.

When you run a SQL SELECT into a cursor or table the target object is closed and re-opened. This means that the Grid is losing its recordsource and so is going blank. If you have no custom tfeatures in the grid (i.e. you are diaplsying all the columns in natural order you can get round this by setting the grid's recordsource property = "" before the select and restoring it afterwards.
Thisform.ordergrid.recordsource = ""
SELECT......INTO TABLE ordergrid
Thisform.ordergrid.recordsource = "ordergrid"

but a better and more generic solution is to use a "Safe Select" as described in my blog article
here:

Regards
Andy Kramek
Microsoft MVP (Visual FoxPro)
Tightline Computers Inc, Akron Ohio, USA

ENTIRE THREAD

select readonly. Posted by Rob @ 8/27/2007 1:59:30 PM
RE: select readonly. Posted by tushar @ 8/27/2007 2:05:23 PM
RE: select readonly. Posted by Andy Kramek @ 8/27/2007 2:28:00 PM
RE: select readonly. Posted by Rob @ 8/30/2007 10:54:33 AM
RE: select readonly. Posted by Andy Kramek @ 8/30/2007 1:11:36 PM
RE: select readonly. Posted by Rob @ 9/3/2007 6:50:41 PM
RE: select readonly. Posted by Andy Kramek @ 9/3/2007 10:58:37 PM
RE: select readonly. Posted by Rob @ 9/4/2007 12:50:36 AM
RE: select readonly. Posted by Ken Murphy @ 9/4/2007 1:26:26 AM