Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filling a grid with output from SQL
Message
From
02/02/2000 19:35:25
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00326283
Message ID:
00326501
Views:
20
>Yesterday's lesson was great. I have the SQL statement written and it is pulling the proper records from the table into a cursor.
>
>I have a form with a text box (for the user to enter the search text), a grid, and a cmdbutton that runs the show.
>
>The user enters the search text, presses the button and I use this:
>
>
>l_cSearchtext='%'+upper(alltrim(ThisForm.txtSearchString.value))+'%'
>
>select * from document where title like l_cSearchtext order by number into cursor temp1
>
>to pull the appropriate records into the cursor temp1.
>
>Now I want the cursor data to be placed in the grid. The grid has its ColumnCount set to -1, the RecordSource to temp1 and the RecordSourceType to 4 - SQL Statement.
>
>After the SQL statement, I refresh the form, but get nothing in the grid....what (OBVIOUS THING) am I missing here?

Set RecordSourceType to 1 (Alias) - type 4 would mean you provided the SQL statement itself as text in RecordSource, rather than the alias of the cursor to reference
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform