小弟我的MFC 程序为什么总是connectionstring 连接失败呢
我的MFC 程序为什么总是connectionstring 连接失败呢?
#import 。。。都添加了,COM 组件也用了,下面是具体的信息,是不是我的电脑还配置什么?求指点,谢谢
try
{
m_pConnection->ConnectionTimeout = 10;
// m_pConnection->ConnectionString="Provider=MSDAORA;DataSourse=devdb;User ID=corona_spc;Password=FISpassword";
m_pConnection->ConnectionString="Provider=MSDAORA.1;Password=FISpassword;User ID=corona_spc;Data Source=devdb;Persist Security Info=True";
MessageBox("DataBase connect ok");
}
catch (_com_error e)
{
AfxMessageBox("DataBase connect faild");
return TRUE;
}
------解决思路----------------------
查看错误信息,同时用数据库验证你的connectionstring
------解决思路----------------------
看下这篇blog如何获取连接字符串的。
#import 。。。都添加了,COM 组件也用了,下面是具体的信息,是不是我的电脑还配置什么?求指点,谢谢
try
{
m_pConnection->ConnectionTimeout = 10;
// m_pConnection->ConnectionString="Provider=MSDAORA;DataSourse=devdb;User ID=corona_spc;Password=FISpassword";
m_pConnection->ConnectionString="Provider=MSDAORA.1;Password=FISpassword;User ID=corona_spc;Data Source=devdb;Persist Security Info=True";
MessageBox("DataBase connect ok");
}
catch (_com_error e)
{
AfxMessageBox("DataBase connect faild");
return TRUE;
}
------解决思路----------------------
查看错误信息,同时用数据库验证你的connectionstring
------解决思路----------------------
看下这篇blog如何获取连接字符串的。