使用ADO创建数据库的问题
做了个简单的小程序,编辑和连接都可以,就是不能执行。出现的错误是:runtime error ! abnormal program temination!!是不是哪里少了什么东西啊,请大虾帮忙啊!!!!!
_ConnectionPtr m_pConnection;
HRESULT hr;
try
{
hr=m_pConnection.CreateInstance("ADODB.Connection");
if(SUCCEEDED(hr))
{
hr=m_pConnection->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=soye.mdb"," "," ",adModeUnknown);
}
}
catch(_com_error *e)
{
CString errormessage;
errormessage.Format("Á¬½ÓÊý¾Ý¿âʧ°Ü:%s",e->ErrorMessage());
AfxMessageBox(errormessage);
}
_variant_t RecordsAffected;
m_pConnection->Execute("CREATE TABLE ¸öÈËÐÅÏ¢(ѧºÅ INTEGER,ÄêÁä INTEGER)",
&RecordsAffected,adCmdText);