MFC 查看数据库是否存在某表

来源:互联网 发布:武汉大学网络自助中心 编辑:程序博客网 时间:2024/04/28 17:41
try
{
CString sql="select 1 from [表名]";
m_AdoConn.OnInitADOConn();
try
{
m_Record=m_AdoConn.m_pCon->Execute((_bstr_t)sql, NULL, adCmdText);
}
catch(_com_error e)
{
//建表

}

//对表的操作
m_AdoConn.ExitConn();
}
catch(_com_error e)
{
return false;
}
0 0
原创粉丝点击