mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-15 08:11:30 +02:00
+ added check for empty dataset to TDataset.Delete
+ Updated comment regarding bookmarks and appending records git-svn-id: trunk@3109 -
This commit is contained in:
parent
d0c327b14b
commit
101dc0fe85
@ -1209,10 +1209,11 @@ end;
|
|||||||
|
|
||||||
Procedure TDataset.Delete;
|
Procedure TDataset.Delete;
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
If Not CanModify then
|
If Not CanModify then
|
||||||
DatabaseError(SDatasetReadOnly,Self);
|
DatabaseError(SDatasetReadOnly,Self);
|
||||||
|
If IsEmpty then
|
||||||
|
DatabaseError(SDatasetEmpty,Self);
|
||||||
if State in [dsInsert] then
|
if State in [dsInsert] then
|
||||||
begin
|
begin
|
||||||
Cancel;
|
Cancel;
|
||||||
@ -1296,6 +1297,9 @@ Procedure TDataset.DoInsertAppend(DoAppend : Boolean);
|
|||||||
fBOF := false;
|
fBOF := false;
|
||||||
// 29:01:05, JvdS: Why is this here?!? It can result in records with the same bookmark-data?
|
// 29:01:05, JvdS: Why is this here?!? It can result in records with the same bookmark-data?
|
||||||
// I would say that the 'internalinsert' should do this. But I don't know how Tdbf handles it
|
// I would say that the 'internalinsert' should do this. But I don't know how Tdbf handles it
|
||||||
|
|
||||||
|
// 1-apr-06, JvdS: It just sets the bookmark of the newly inserted record to the place
|
||||||
|
// where the record should be inserted. So it is ok.
|
||||||
if FRecordcount > 0 then
|
if FRecordcount > 0 then
|
||||||
SetBookMarkData(ActiveBuffer,pointer(BookBeforeInsert));
|
SetBookMarkData(ActiveBuffer,pointer(BookBeforeInsert));
|
||||||
end;
|
end;
|
||||||
|
@ -77,6 +77,7 @@ Const
|
|||||||
SUnsupportedFieldType = 'Fieldtype %s is not supported';
|
SUnsupportedFieldType = 'Fieldtype %s is not supported';
|
||||||
SInvPacketRecordsValue = 'PacketRecords has to be larger then 0';
|
SInvPacketRecordsValue = 'PacketRecords has to be larger then 0';
|
||||||
SInvalidSearchFieldType = 'Searching in fields of type %s is not supported';
|
SInvalidSearchFieldType = 'Searching in fields of type %s is not supported';
|
||||||
|
SDatasetEmpty = 'The dataset is empty';
|
||||||
|
|
||||||
Implementation
|
Implementation
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user