Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Columns dissapear when recreating the cursor...
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00158806
Message ID:
00159318
Views:
21
>Ok...
>
>I have a form that allows the user to specify four parameters of a view. When they press the Find button, I populate the vp's and requery the view...
>
>I have a grid, the columns are bound to the cursor... after I requery the view the grid shows the records that match the parameters... So far so good.
>
>Now, I added a Selection Criteria checkbox. This brings up StoneField Query to allow the user to build a WHERE clause that is not limited to the four view parameters.
>
>Using cursorgetprop I parse out the SQL statement and rebuild it with a new WHERE based on the return from SFQuery. I add an INTO CURSOR of the same name as the original view.
>
>I close the original view and run the query. The query does create the new cursor with the correct records... however, the grid that is bound to the cursor has now lost its columns.
>
>I assume the happens when I remove the DE that had the original view.
>
>Anyone have any ideas how to work around this? Hopeing to avoid writting code that will addobject the columns to the grid again?
>
>Thanks,
>BOb
>
>BTW: I am trying to get an effect simmilar to the QBF article in August FoxAdvisor, but using SFQuery rather than a QBF form I build myself.
>
>Eventually, instead of creating a CURSOR... I will create a view with a temp name, and use it with an alias. This way this code will work with local and remote views, and not have to use SPT.

Set the .RecordSource property to SPACE(0). Recreate your cursor and assign the .RecordSource again. I even created a method in my grid class called .BlankGrid which eliminates the header captions too so while the SQL statement is processing, the grid is blank until the new data appears.

Steve
Previous
Reply
Map
View

Click here to load this message in the networking platform