有什么办法可以判断数据库中是否存在某表? rt 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 可以搜索它的系统表(例如ms sql的sysobjects)或者 select * from tablename 获取错误信息 可以搜索它的系统表(例如ms sql的sysobjects)或者 select * from tablename 获取错误信息------------统一 BOOL bExist = TRUE;CDaoTableDefInfo tableInformation; // only needed for the callTRY{ pModelData->GetTableDefInfo(strTableName, tableInformation);}CATCH (CDaoException, e){ if (e->m_pErrorInfo->m_lErrorCode == 3265) bExist = FALSE; //表不存在}AND_CATCH (CMemoryException, e){}END_CATCH try { m_recordSet = m_connection->OpenSchema (adSchemaTables,vtMissing,vtMissing); while ( !m_recordSet->EOF ) { tablesNames = m_recordSet->Fields->Item[L"TABLE_NAME"]->Value; kooky = (char*) tablesNames; if (kooky.Left(4) != "MSys") m_tablesList.AddString( kooky ); m_recordSet->MoveNext(); } } catch(...) {} 我的数据库是access 2000的,据说DAO驱动不支持,还有没有其他方法 VC6.0与ACCESS2000 BOOL CYourApp::InitInstance() { AfxEnableControlContainer(); AfxGetModuleState()->m_dwVersion = 0x0601; //增加此行 ..... } http://expert.csdn.net/Expert/topic/1138/1138945.xml?temp=.6502497 对同一窗口连续调用GetDC函数,为什么返回值都不一样? 窗口大小自适应分辨率 如何实现点击按钮后按钮无效,按钮中程序执行完后自动恢复,再此过程中再此点击按钮不响应 关于网络传输中CRC的问题! WTL Ownerdraw 高手们,如何将列表框分列呀,m_list.InsertColumn? ★★★★★千分学习OS问题之二 ★★关于进程的状态问题!★★ 类向导没了 各位大虾,俺有个问题,javascript的数组如何传到dll里面,我如何在dll里面处理呀,急 如何改变对话框的背景? 记录拷贝方法? ----->help<------在线等待!!!!!!!!!!!
或者 select * from tablename 获取错误信息
或者 select * from tablename 获取错误信息------------统一
CDaoTableDefInfo tableInformation; // only needed for the call
TRY
{
pModelData->GetTableDefInfo(strTableName, tableInformation);
}
CATCH (CDaoException, e)
{
if (e->m_pErrorInfo->m_lErrorCode == 3265)
bExist = FALSE; //表不存在
}
AND_CATCH (CMemoryException, e)
{
}
END_CATCH
{
m_recordSet = m_connection->OpenSchema (adSchemaTables,vtMissing,vtMissing);
while ( !m_recordSet->EOF )
{
tablesNames = m_recordSet->Fields->Item[L"TABLE_NAME"]->Value;
kooky = (char*) tablesNames;
if (kooky.Left(4) != "MSys")
m_tablesList.AddString( kooky );
m_recordSet->MoveNext();
}
}
catch(...) {}
BOOL CYourApp::InitInstance()
{
AfxEnableControlContainer();
AfxGetModuleState()->m_dwVersion = 0x0601; //增加此行
.....
}