下面是用于创建数据库连接,并限制结果集的大小,但是为什么每次查询内存还是无法控制,不能控制在一定的数量上?谢谢!
con.CreateInstance("ADODB.Connection");///创建Connection对象
rst.CreateInstance("ADODB.Recordset");
CString strPath="File Name=";
strPath+=strCurrentPath;
strPath+="\\connectString.udl";
con->ConnectionString=(LPCTSTR)strPath;
con->Open("","",_bstr_t(""),-1);
rst->MaxRecords=5100;
rst->CacheSize=5000;