If (FAILED (nRet))
{
_com_error e (nRet);
AfxMessageBox (e.E rrorMessage ());
return FALSE;
}
Cstrings strConn=
(" the Provider=SQLOLEDB. 1; Persist Security Info=False;"
"User ID=so; Password=12345678;"
"Initial Catalog=time; The Data Source=1 XX. XX. XX. XX." );
nRet=m_pConn - & gt; Open ((_bstr_t) strConn, ""," ", NULL);//in this step will make a mistake
If (FAILED (nRet))
{
_com_error e (nRet);
AfxMessageBox (e.E rrorMessage ());//show "unspecified error"
return FALSE;
}
Native IP database using SQL Server Management Studio is accessible, but not a use ADO,
the same code, just change the IP, access to other IP database,
See the account access these are right, firewall also try a modified IP can't,
Ask colleagues for the first time see, the great god knows what reason be?
CodePudding user response:
Is not a great god, "the same code, just change the IP, access to other IP database can be," that's code for, the remaining problems setting up the database software, try other computer using SQL Server Management Studio ok for database connection you not on the road, not heavy,CodePudding user response: