vs2008连接SQL2005 EXPRESS的问题!!!急
宇宙漫步者 2010-11-05 05:18:07 CoInitialize(NULL);
//AfxOleInit();
_ConnectionPtr pConn(__uuidof(Connection));
// _RecordsetPtr pRst(__uuidof(Recordset));
// _CommandPtr pCmd(__uuidof(Command));//实例化一个Command对象pCmd
try
{
pConn.CreateInstance("ADODB.Connection");
pConn->Open("Data Source=FANGANG-PC\SQLEXPRESS;Initial Catalog=HelloSQL2005;Integrated Security=True;User ID=FANGANG;Password=103519;","","",adModeUnknown);
}
catch(_com_error e)
{
AfxMessageBox(e.Description());
}
总是提示如下错误:
多步OLE DB产生错误 如有可能,请检查每个OLE DB值状态值,没有工作被完成。