BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TAdoDataset MaxRecords weird

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop)
View previous topic :: View next topic  
Author Message
Miguel Gastelumendi
Guest





PostPosted: Wed Aug 20, 2008 3:24 pm    Post subject: TAdoDataset MaxRecords weird Reply with quote



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
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop) All times are GMT
Page 1 of 1

 
 


Powered by phpBB © 2001, 2006 phpBB Group
.