Browse Source

* Added check for circular datasource reference

git-svn-id: trunk@8167 -
michael 18 years ago
parent
commit
9bc1c04688
2 changed files with 4 additions and 1 deletions
  1. 2 1
      packages/fcl-db/src/dbconst.pas
  2. 2 0
      packages/fcl-db/src/sqldb/sqldb.pp

+ 2 - 1
packages/fcl-db/src/dbconst.pas

@@ -95,7 +95,8 @@ Resourcestring
   SNoFieldIndexes          = 'No index currently active';
   SNotIndexField           = 'Field ''%s'' is not indexed and cannot be modified';
   SErrUnknownConnectorType = 'Unknown connector type';
-
+  SErrCircularDataSourceReferenceNotAllowed = 'Circular datasource references are not allowed.';
+  
 
 Implementation
 

+ 2 - 0
packages/fcl-db/src/sqldb/sqldb.pp

@@ -1413,6 +1413,8 @@ begin
   DS:=DataSource;
   If (AValue<>DS) then
     begin
+    If (AValue.Dataset=Self) then
+      DatabaseError(SErrCircularDataSourceReferenceNotAllowed,Self);
     If Assigned(DS) then
       DS.RemoveFreeNotification(Self);
     If Assigned(AValue) then