浏览代码

* fix for persistent fields
* Removed obsolete call of InternalInitFieldDef

git-svn-id: trunk@5774 -

joost 18 年之前
父节点
当前提交
0c18a09c2b
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      fcl/db/sqldb/sqldb.pp

+ 6 - 1
fcl/db/sqldb/sqldb.pp

@@ -850,6 +850,7 @@ begin
     (Database as tsqlconnection).AddFieldDefs(fcursor,FieldDefs);
   finally
     FLoadingFieldDefs := False;
+    FCursor.FInitFieldDef := false;
   end;
 end;
 
@@ -1018,6 +1019,8 @@ begin
     if FCursor.FStatementType in [stSelect] then
       begin
       Execute;
+      // InternalInitFieldDef is only called after a prepare. i.e. not twice if
+      // a dataset is opened - closed - opened.
       if FCursor.FInitFieldDef then InternalInitFieldDefs;
       if DefaultFields then
         begin
@@ -1041,7 +1044,9 @@ begin
               end;
             end;
           end;
-        end;
+        end
+      else
+        BindFields(True);
       if FUpdateable then
         begin
         InitialiseModifyQuery(FDeleteQry,FDeleteSQL);