Browse Source

* Make sure FieldDefs.Update operates on prepared query

git-svn-id: trunk@43037 -
michael 5 years ago
parent
commit
9396decb19
1 changed files with 13 additions and 0 deletions
  1. 13 0
      packages/fcl-db/src/sqldb/sqldb.pp

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

@@ -536,6 +536,7 @@ type
     procedure ApplyFilter;
     procedure ApplyFilter;
     Function AddFilter(SQLstr : string) : string;
     Function AddFilter(SQLstr : string) : string;
   protected
   protected
+    procedure OpenCursor(InfoQuery: Boolean); override;
     function CreateSQLStatement(aOwner: TComponent): TCustomSQLStatement; virtual;
     function CreateSQLStatement(aOwner: TComponent): TCustomSQLStatement; virtual;
     Function CreateParams: TSQLDBParams; virtual;
     Function CreateParams: TSQLDBParams; virtual;
     Function RefreshLastInsertID(Field: TField): Boolean; virtual;
     Function RefreshLastInsertID(Field: TField): Boolean; virtual;
@@ -2791,6 +2792,18 @@ begin
   Result := SQLstr;
   Result := SQLstr;
 end;
 end;
 
 
+procedure TCustomSQLQuery.OpenCursor(InfoQuery: Boolean);
+begin
+  if InfoQuery then
+    CheckPrepare;
+  try
+    inherited OpenCursor(InfoQuery);
+  finally
+    if InfoQuery then
+      CheckUnPrepare;
+  end;
+end;
+
 function TCustomSQLQuery.NeedRefreshRecord(UpdateKind: TUpdateKind): Boolean;
 function TCustomSQLQuery.NeedRefreshRecord(UpdateKind: TUpdateKind): Boolean;