MFC中用ADO连接数据库的数据库文件如何附加?
程序里是这样写的::CoInitialize(NULL);try{m_pConnection.CreateInstance("ADODB.Connection");_bs...
程序里是这样写的
::CoInitialize(NULL);
try
{
m_pConnection.CreateInstance("ADODB.Connection");
_bstr_t strConnect = "Provider=SQLOLEDB; Server=(local);Database=ClassMaster; uid=sa; pwd=;";
m_pConnection->Open(strConnect,"","",adModeUnknown);
}
catch(_com_error e)
{
AfxMessageBox(e.Description());
}
他这里面只有一个ClassMaster文件没有后缀,SQL 2000也附加不进去,我怎么打开这个数据源呢 展开
::CoInitialize(NULL);
try
{
m_pConnection.CreateInstance("ADODB.Connection");
_bstr_t strConnect = "Provider=SQLOLEDB; Server=(local);Database=ClassMaster; uid=sa; pwd=;";
m_pConnection->Open(strConnect,"","",adModeUnknown);
}
catch(_com_error e)
{
AfxMessageBox(e.Description());
}
他这里面只有一个ClassMaster文件没有后缀,SQL 2000也附加不进去,我怎么打开这个数据源呢 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询