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!

 
ZirckAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tusharkanvindeCommented:
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 http://mtmyvfp.codeplex.com
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pcelbaCommented:
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.
0
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!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FoxPro

From novice to tech pro — start learning today.