Browse Source

* Aded some constants to dbconst for delphi-compatibility, bug #8218

git-svn-id: trunk@6609 -
joost 18 years ago
parent
commit
c6be9a7200
4 changed files with 13 additions and 7 deletions
  1. 2 2
      fcl/db/bufdataset.pp
  2. 2 2
      fcl/db/dataset.inc
  3. 7 1
      fcl/db/dbconst.pp
  4. 2 2
      fcl/db/sqlite/customsqliteds.pas

+ 2 - 2
fcl/db/bufdataset.pp

@@ -599,7 +599,7 @@ var CurrBuff : pointer;
 begin
   if not (state in [dsEdit, dsInsert, dsFilter, dsCalcFields]) then
     begin
-    DatabaseErrorFmt(SNotInEditState,[Name],self);
+    DatabaseErrorFmt(SNotEditing,[Name],self);
     exit;
     end;
   if state = dsFilter then  // Set the value into the 'temporary' FLastRecBuf buffer for Locate and Lookup
@@ -1139,7 +1139,7 @@ begin
     begin
     if not (state in [dsEdit, dsInsert, dsFilter, dsCalcFields]) then
       begin
-      DatabaseErrorFmt(SNotInEditState,[Name],self);
+      DatabaseErrorFmt(SNotEditing,[Name],self);
       exit;
       end;
 

+ 2 - 2
fcl/db/dataset.inc

@@ -1922,7 +1922,7 @@ begin
     DoAfterPost;
     end
   else
-    DatabaseErrorFmt(SNotInEditState, [Name], Self);
+    DatabaseErrorFmt(SNotEditing, [Name], Self);
 end;
 
 Procedure TDataset.Prior;
@@ -2076,7 +2076,7 @@ Procedure TDataset.UpdateRecord;
 
 begin
   if not (State in dsEditModes) then
-    DatabaseErrorFmt(SNotInEditState, [Name], Self);
+    DatabaseErrorFmt(SNotEditing, [Name], Self);
   DataEvent(deUpdateRecord, 0);
 end;
 

+ 7 - 1
fcl/db/dbconst.pp

@@ -59,7 +59,7 @@ Resourcestring
   SNotAFloat               = '"%s" is not a valid float';
   SNotAninteger            = '"%s" is not a valid integer';
   SNotConnected            = 'Operation cannot be performed on an disconnected database';
-  SNotInEditState          = 'Operation not allowed, dataset "%s" is not in an edit state.';
+  SNotEditing              = 'Operation not allowed, dataset "%s" is not in an edit or insert state.';
   SParameterNotFound       = 'Parameter "%s" not found';
   SRangeError              = '%f is not between %f and %f for %s';
   SReadOnlyField           = 'Field %s cannot be modified, it is read-only.';
@@ -89,6 +89,12 @@ Resourcestring
   SNoUpdateFields          = 'There are no fields found to include in the update- or insert-clause';
   SNotSupported            = 'Operation is not supported by this type of database';
   SDBCreateDropFailed      = 'Creation or dropping of database failed';
+// These are added for Delphi-compatilility, but not used by the fcl:
+  SFieldIndexError         = 'Field index out of range';
+  SIndexFieldMissing       = 'Cannot access index field ''%s''';
+  SNoFieldIndexes          = 'No index currently active';
+  SNotIndexField           = 'Field ''%s'' is not indexed and cannot be modified';
+
 
 Implementation
 

+ 2 - 2
fcl/db/sqlite/customsqliteds.pas

@@ -411,7 +411,7 @@ begin
   begin
     if not (State in [dsEdit, dsInsert]) then
     begin
-      DatabaseErrorFmt(SNotInEditState,[Name],Self);
+      DatabaseErrorFmt(SNotEditing,[Name],Self);
       Exit;
     end;
     StrDispose(FCacheItem^.Row[Field.FieldNo - 1]);
@@ -1050,7 +1050,7 @@ var
 begin
   if not (State in [dsEdit, dsInsert]) then
   begin
-    DatabaseErrorFmt(SNotInEditState,[Name],Self);
+    DatabaseErrorFmt(SNotEditing,[Name],Self);
     Exit;
   end;
   StrDispose(FCacheItem^.Row[Pred(Field.FieldNo)]);