我用的是windows nt方式登陆数据库,我的连接代码如下:
try
{
::CoInitialize(NULL);
m_Connect.CreateInstance(__uuidof(Connection));
m_Recordset.CreateInstance(__uuidof(Recordset));
m_Connect->Open(strConnect,"","",NULL);
}
catch(_com_error &e)
{
CString str;
str.Format("ADO ERROR AT %s",e.Description ());
AfxMessageBox(str);
}
//strConnect="Provider=SQLOLEDB; Server=DHB;"
             "Database=Misdb; uid=; pwd=;";
而我每次连接的时候它自动改为:uid=Administrator;pwd=sa;
//因为我的登陆密码是那么多
但是还是失败,显示为:
_com_error::Description returned {"Login failed for user 'Administrator'. Reason: Not associated with a trusted SQL Server connection." (1)}
原因??
如果可以改为另外的登陆方式怎么改呢???
谢谢!!