Application freeze few seconds - Visual FoxPro

Hi all,

Quick question!!

I have a front-end side application with foxpro linked to a SQL back-end.

I have 3 timers inside my application and specially one for a digital clock.

My problem, I have a procedure inside one timer to check and catch SQL connection and disconnection from the server. When this timer catch a disconnection, he try to reconnect. I have set the SQLSETPROP(0,"ConnectTimeOut",5) but between this 5 sec, everything freeze... The clock and all the other stuff....

Is there a way to let the application run normally, other timers and user function in this lap of time?

I have a READ EVENTS in my launching prog and a CLEAR EVENTS in my release code but it's seem to be not the solution...

Thanks for your input!

Who is Participating?
tusharkanvindeConnect With a Mentor Commented:
VFP is a single threaded application. So long as you keep it to single thread, it will hang while it checks the connection. Why do you want to keep checking. When you send the SQLEXEC, check for error and at that time, if you want, to can reconnect.

If you really want to multithread, check out
I would say three timers are more dangerous than disconnected SQL Server instance. Timer is something "less obvious" which results in less stable code. Simple timers work correctly but my experience says the form stability is degraded if more timers are executed at the same time.

If you would simply check the SQL Server availability when needed then you'll get same result as if it is checked periodically.
ZirckAuthor Commented:
Thank you,

It's more clear for me now!!

I will look too for multi-thread for my own understanding!

Thanks for the link!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.