连接超时问题 [英] Connection timeout problems

查看:69
本文介绍了连接超时问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我真的希望有人能给我一些帮助.

我有一个连接到odbc数据源的vb6应用程序.我正在尝试编写一个函数,该函数将告诉我与sql的连接是否仍处于打开状态,以便我可以使我的应用程序脱机(如果没有断开连接),但是每次查询odbc连接时,我的应用程序都将挂起,并且必须通过以下方式将其关闭任务管理器.我已经尝试设置连接和命令超时属性.有什么建议?

在此先感谢:)

Hi guys and girls, I really hope someone can give me some help.

I have a vb6 app that connects to an odbc datasource. I''m trying to write a function that will tell me whether the connection to sql is still open so that I can take my app offline if not, but everytime I query the odbc connection, my app hangs and I have to close it via task manager. I have already tried setting the connection and command time out properties. Any suggestions?

Thanks in advance :)

推荐答案

我认为您的代码陷入了一个continue循环中.因此,请两次检查您的代码.
间隔使用定时器控制.并且在执行查询之前停止计时器,直到执行完成.因为如果执行时间很长,则可能因此而触发下一次计时器控制触发,因此您的应用程序可能会挂起..
I think your code fall in a continues loop. So check your code twice.
Use timer control with good interval. And also before execute your query stop timer until execution complete. Because if execution time take long then next trigger of timer control may occur for this reason your application may hang..


这篇关于连接超时问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆