Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to requery my SQL grid
Message
From
03/02/2011 14:00:06
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01498606
Message ID:
01498620
Views:
49
You're welcome. This method should be in the help file, but unfortunately it's not.

>That's fantastic Tore, many thanks for sharing.
>
>Tried it & it works a treat
>
>Long live the Fox
>
>>The "safe select" method is the safe method to avoid rebuilding the grid. Since you never change the controlsource, thus no need to regenerate. Try it, it's an extremely helpful solution.
>>
>>It's quite easy.

    >>
  1. Select the wanted data into a dummy cursor

  2. >>
  3. Select the work are where the cursor that drives the grid is

  4. >>
  5. Zap it to remove all records

  6. >>
  7. Append new data from the temp cursor

  8. >>
  9. Refresh the grid

>>
>>
>>
>>>Hi Tore
>>>
>>>Am I missing something? What is the "safe select" method, I was under the impression that if you zap the file that is the row source that rips the rug from under the grid, and the grid goes blank?
>>>
>>>>By using the "safe select" method
>>>>select cname,type,desc,date,operator,startfinish,transid  from wipdata!logfile,operators into cursor tmplog where jobno=wipdata.jobno;
>>>>and operator=operators.nempno order by date into cursor CurTemp
>>>>Select Tmplog && Cursor that drives the grid
>>>>Zap
>>>>Append from dbf('CurTemp')
>>>>yourgrid.refresh()
>>>>NB! Make sure to add the keyword Readwrite to the select that populates the grid, or you can't zap it.
>>>>
>>>>>I have a grid on my form, it's row source is a SQL command that create
>>>>>
>>>>>
>>>>>select cname,type,desc,date,operator,startfinish,transid  from wipdata!logfile,operators into cursor tmplog where jobno=wipdata.jobno
>>>>> and operator=operators.nempno order by date
>>>>>
>>>>>
>>>>>How do I get the SQL command to refire & regenerate the data for my grid?
>>>>>
>>>>>Many thanks
Previous
Reply
Map
View

Click here to load this message in the networking platform