ADO连接,如何知道,用户名和密码正确,或不对?? ADO连接如何知道用户名是否正确,用户名正确的话,又如何知道密码是否正确(数据库为ORACLE,SQL SERVER).我要做在输入正确用户名和密码才能连接ADO,怎么做? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 try{ pConn->Open(...);}catch(_com_error &e){ _bstr_t bstrSQLState(GetSQLState(m_pConnection)); //或者查看pConn->Errors[0]}http://msdn.microsoft.com/library/default.asp?url=/library/en-us/oledb/htm/oledberrors.asp 怎么描述呀,哪里有全部ADO错误代码? catch(_com_error * e) { AfxMessageBox(e->ErrorMessage()); } catch(...) { long errorcount=m_pConnection->GetErrors ()->GetCount (); _bstr_t add; CString errormsg; for (short i=0;i<errorcount;i++) { add=m_pConnection->GetErrors ()->GetItem (COleVariant((short)i))->GetDescription (); errormsg.Insert (0,(char*)add); errormsg+="\r"; } AfxMessageBox(errormsg); } 在VS2008下 防止头文件被重用的问题 皮肤文件的如何制作与使用? 大家一起讨论多人视频会议源码 如何得到ListCtrl的列的个数 编制这种组件的可行性? 关于CDialog::DoModal() VC中怎么样使另一个程序运行? 谁有关于CreateWindow的代码看一下? 请问如何使 ListCtrl 中的一项设为蓝色被选择状态? 在VC++程序中捕获另一应用程序的控件句柄并可以操作此控件 在VC++中如何修改控件的属性(比如可见,不可见,可用,不可用)之类的 帮帮忙,关于编译问题
{
pConn->Open(...);
}
catch(_com_error &e)
{
_bstr_t bstrSQLState(GetSQLState(m_pConnection));
//或者查看pConn->Errors[0]
}http://msdn.microsoft.com/library/default.asp?url=/library/en-us/oledb/htm/oledberrors.asp
{
AfxMessageBox(e->ErrorMessage());
}
catch(...)
{
long errorcount=m_pConnection->GetErrors ()->GetCount ();
_bstr_t add;
CString errormsg;
for (short i=0;i<errorcount;i++)
{
add=m_pConnection->GetErrors ()->GetItem (COleVariant((short)i))->GetDescription ();
errormsg.Insert (0,(char*)add);
errormsg+="\r";
}
AfxMessageBox(errormsg);
}