fcl-db: cosmetic

git-svn-id: trunk@27127 -
This commit is contained in:
lacak 2014-03-13 13:41:29 +00:00
parent 28e0a453c7
commit cf42b3bdc0
2 changed files with 9 additions and 5 deletions

View File

@ -1262,6 +1262,8 @@ var r : integer;
begin begin
FOpen:=False; FOpen:=False;
FReadFromFile:=False;
if FIndexesCount>0 then with FIndexes[0] do if IsInitialized then if FIndexesCount>0 then with FIndexes[0] do if IsInitialized then
begin begin
iGetResult:=ScrollFirst; iGetResult:=ScrollFirst;
@ -1305,7 +1307,6 @@ begin
if FAutoIncValue>-1 then FAutoIncValue:=1; if FAutoIncValue>-1 then FAutoIncValue:=1;
if assigned(FParser) then FreeAndNil(FParser); if assigned(FParser) then FreeAndNil(FParser);
FReadFromFile:=false;
end; end;
procedure TCustomBufDataset.InternalFirst; procedure TCustomBufDataset.InternalFirst;
@ -2976,7 +2977,7 @@ procedure TCustomBufDataset.CreateDataset;
var AStoreFileName: string; var AStoreFileName: string;
begin begin
CheckInactive; CheckInactive;
if ((FieldCount=0) or (FieldDefs.Count=0)) then if ((Fields.Count=0) or (FieldDefs.Count=0)) then
begin begin
if (FieldDefs.Count>0) then if (FieldDefs.Count>0) then
CreateFields CreateFields
@ -2989,7 +2990,7 @@ begin
raise Exception.Create(SErrNoFieldsDefined); raise Exception.Create(SErrNoFieldsDefined);
FAutoIncValue:=1; FAutoIncValue:=1;
end; end;
// When a FileName is set, do not read from this file // When a FileName is set, do not read from this file; we want empty dataset
AStoreFileName:=FFileName; AStoreFileName:=FFileName;
FFileName := ''; FFileName := '';
try try

View File

@ -2171,13 +2171,16 @@ begin
// so let them do cleanup f.e. cancel pending queries and/or free resultset // so let them do cleanup f.e. cancel pending queries and/or free resultset
if not Prepared then FStatement.DoUnprepare; if not Prepared then FStatement.DoUnprepare;
end; end;
if DefaultFields then if DefaultFields then
DestroyFields; DestroyFields;
FIsEOF := False; FIsEOF := False;
if assigned(FUpdateQry) then FreeAndNil(FUpdateQry); if assigned(FUpdateQry) then FreeAndNil(FUpdateQry);
if assigned(FInsertQry) then FreeAndNil(FInsertQry); if assigned(FInsertQry) then FreeAndNil(FInsertQry);
if assigned(FDeleteQry) then FreeAndNil(FDeleteQry); if assigned(FDeleteQry) then FreeAndNil(FDeleteQry);
// FRecordSize := 0; // FRecordSize := 0;
inherited InternalClose; inherited InternalClose;
end; end;
@ -2201,7 +2204,7 @@ end;
procedure TCustomSQLQuery.InternalOpen; procedure TCustomSQLQuery.InternalOpen;
var counter, fieldc : integer; var counter, fieldc : integer;
f : TField; F : TField;
IndexFields : TStrings; IndexFields : TStrings;
begin begin
if IsReadFromPacket then if IsReadFromPacket then
@ -2248,7 +2251,7 @@ begin
ExtractStrings([';'],[' '],pchar(ServerIndexDefs[counter].fields),IndexFields); ExtractStrings([';'],[' '],pchar(ServerIndexDefs[counter].fields),IndexFields);
for fieldc := 0 to IndexFields.Count-1 do for fieldc := 0 to IndexFields.Count-1 do
begin begin
F := Findfield(IndexFields[fieldc]); F := FindField(IndexFields[fieldc]);
if F <> nil then if F <> nil then
F.ProviderFlags := F.ProviderFlags + [pfInKey]; F.ProviderFlags := F.ProviderFlags + [pfInKey];
end; end;