 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Miguel Gastelumendi Guest
|
Posted: Wed Aug 20, 2008 3:24 pm Post subject: TAdoDataset MaxRecords weird |
|
|
Hi,
We encountered this strange behaviour of MAXRECORDS of ADODataSet. If
you set:
ADODataSet1.CommandText:= ‘select * from ‘<table>;
ADODataSet1.CommandType:= cmdText;
ADODataSet1.Connection:= ADOConnection1;
ADODataSet1.MaxRecords:= 1;
It will bring, as expected, one record. Next, if you do:
ADODataSet1.Close;
ADODataSet1.MaxRecords:= 0;
ADODataSet1.Open;
It will insist and bring only one record. If MaxRecords is set to 2,
10, 30… ADODataSet1 will obey and bring the specified amount of
records. But, the only way to make it bring ALL records (ie
maxrecords=0) was clearing the Connection:
ADODataSet1.Close;
ADODataSet1.Connection:= nil;
ADODataSet1.MaxRecords:=0;
ADODataSet1.Connection:= ADOConnection1;
ADODataSet1.Open;
Any ideas way this happens?
The other ADODataSet1 properties are the default ones; we checked it
in Delphi 7 & 5, with MS SQL 2000 & 2005 Express. |
|
| Back to top |
|
 |
Powered by phpBB © 2001, 2006 phpBB Group .
|