Visual C ++ MFC-SQL Express [英] 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屋!