Visual C ++ MFC-SQL Express [英] Visual C++ MFC - SQL Express

查看:70
本文介绍了Visual C ++ MFC-SQL Express的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这曾经有用-使用ODBC将可视c ++程序连接到sql express数据库.工作几个月后,我知道执行打开命令时会出现超时错误(if(!m_pDB-> Open(_T("CardServer2"),FALSE,FALSE,_T("ODBC; UID = NULL")).我在ODBC中进行了测试连接,并且可以找到它,但是当我尝试执行该程序时-它超时并显示以下错误消息:SQLState:S1 T00 SQL Server错误:0.

This used to work - Connecting a visual c++ program to a sql express database using ODBC. after working for months, I know get a timeout error when executing the open command (if(!m_pDB->Open(_T("CardServer2"), FALSE, FALSE, _T("ODBC;UID=NULL"))). I did a test connection in ODBC and it worked find, however when I try to execute the program - it times out with the error message: SQLState: S1 T00 SQL Server Error: 0. Have tried everything everything be uninstall - reinstall. As I said before, this used to work fine. Any ideas.

推荐答案

您可以在打开数据库之前尝试设置ConnectionTimeout.
you can try to set ConnectionTimeout before you Open your database.


这篇关于Visual C ++ MFC-SQL Express的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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