Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random error
Message
 
 
To
17/10/2001 13:46:44
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Miscellaneous
Thread ID:
00569767
Message ID:
00569773
Views:
17
Hi Pavel,
You don't have to recreate grid every time. Set all the grid properties and controls once. Before retrieving a new data set Recordsource to the empty string and restore it back to the cursor name after that.

>I have a form with grid and timer. It 24 hours/day displaing some data. Timer interval is between 10 and 60 seconds. This form running sometime 1 week without error and sometime it crashes after hours.
>Timer event call this code:
>
>thisform.timer.enabled=.f.
>thisform.grid.RecordSource=""
>thisform.grid.ColumnCount=0
>* select from Oracle backend
>if SqlExec(handle,"select ...","MyAlias")
> if reccount()=0
> * display no data
> else
> with thisform.grid
> .ColumnCount=5
> .RecordSource="MyAlias"
> endwith
> with thisform.grid.column1
> .ControlSource="MyAlias.field1"
> .DynamicBackColor="iif(MyAlias.field5=1,rgb(255,0,0),rgb(255,255,255))"
> endwith
> * other columns, only text controls
> endif
>else
> * display error connection to Oracle
>endif
>thisform.timer1.enabled=.t.
>*(I'm making all my grids this way with no problems.)
>
>Error is coming with "error 10" - syntax of DynamicBackColor is invalid. Why ?
>So I run this form in development environment and after some days I've got the error and under this I found popular error C000005.
>
>I found only one way - put ListBox instead of grid. But it's not solving problem.
>
>Does help removing and adding grid object or other trick ?
>
>Pavel
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform