VC6.0用ADO连接Access数据库不报错,但是无法通过ado建表
我在连接时候用了一系列的catch也没有发现错误,但是点击我设置的建表键,就会弹出对话框报错,如下:
debug error!
program:...soft Visual
studio\myproject\datasystem\debug\datasystem.exe
abnormal program termination
(press retry to debug the application)
建表部分代码如下:
void CDatasystemDlg::OnBUTTONCreattable()
{
// TODO: Add your control notification handler code here
CString strsql;
variant_t RecordsAffected;
try
{
strsql="drop table leida";
theApp.m_pConnection->Execute(_bstr_t(strsql),&RecordsAffected,adCmdText);
}
catch (_com_error* e)
{
MessageBox("Drop table Error");
return;
}
try
{
strsql="Create table leida(number text,place text,type text,tech text,country text,freq text,pw text,fr text);";
theApp.m_pConnection->Execute(_bstr_t(strsql),&RecordsAffected,adCmdText);
}
catch (_com_error* e)
{
MessageBox("Create table Error");
return;
}
}
各位大神求助啊!