下述代码为什么到了movelast 就出了异常?要取得最后纪录的字段值,用什么方法?
USES_CONVERSION;
::CoInitialize(NULL);
_ConnectionPtr con(__uuidof(Connection));
_RecordsetPtr rst(__uuidof(Recordset));
con->ConnectionString="File Name=E:\\connectString.udl";
try
{
  con->Open("","",_bstr_t(""),-1);
}
catch(_com_error &e)
{
con=NULL;
MessageBox(NULL,"不能打开数据库","警告",MB_OK);
return;
}
_variant_t RecordsAffected;
con->Execute("create table ...");
rst->Open("select * from user",_variant_t((IDispatch*)con,true),adOpenStatic,adLockOptimistic,adCmdText);
HRESULT hresult;
int  rc;
hresult=rst->MoveLast();
rc=rst->GetRecordCount();