Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Questions about SQL SELECT to fill a Grid
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00447308
Message ID:
00447312
Views:
6
Put the SQL statement in the Form's Load event. By the time the Form Init fires, the Grid has already initialized. When it can't find the alias, I believe it unbinds itself.

HTH.

>I have a grid on a form. I have an SQL SELECT statement in the form init.
>
>My SELECT code:
>
>SELECT master.incident, master.patnum, master.patqty, master.name_last, master.name_first, ;
>	master.sitename, master.addr1a, master.citya, ;
>	master.mcoid, master.date, arrest.sca_ctr, arrest.closed, arrest.incident ;
>	FROM master JOIN arrest ON master.incident = arrest.incident ;
>	ORDER BY master.date INTO CURSOR cuRowSource
>
>
>I set Grid RowSource to cuRowSource and Grid RowSourceType to 1-Alias. How come I get a blank grid at run time. When I change Grid RowSource to the Default I get a grid showing my Column Headings and Widths, but the columns are partially filled with data from my SELECT and some columns are left blank. I have never used a grid like a Listbox before. What might I be doing wrong?
>
>I assign the grid's column headings and column widths in the Grid Init Event. Do I have to also assign each column to a SQL SELECT fieldname? Or how is that done? I assumed the SQL SELECT would fill the grid in the order that the fields are listed in the SQL SELECT statement. But that's when I get a blank grid with no headings, no lines, no data. What's wrong?
>
>Thanks so much.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform