mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-04 03:50:23 +02:00
* Removed totally useless "try .. except raise end" block
git-svn-id: trunk@12514 -
This commit is contained in:
parent
11015eb6ad
commit
f722533e9a
@ -1183,61 +1183,56 @@ var tel, fieldc : integer;
|
|||||||
IndexFields : TStrings;
|
IndexFields : TStrings;
|
||||||
ReadFromFile: Boolean;
|
ReadFromFile: Boolean;
|
||||||
begin
|
begin
|
||||||
try
|
ReadFromFile:=IsReadFromPacket;
|
||||||
ReadFromFile:=IsReadFromPacket;
|
Prepare;
|
||||||
Prepare;
|
if FCursor.FStatementType in [stSelect,stExecProcedure] then
|
||||||
if FCursor.FStatementType in [stSelect,stExecProcedure] then
|
begin
|
||||||
|
if not ReadFromFile then
|
||||||
begin
|
begin
|
||||||
if not ReadFromFile then
|
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
|
begin
|
||||||
Execute;
|
CreateFields;
|
||||||
// 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
|
|
||||||
CreateFields;
|
|
||||||
|
|
||||||
if FUpdateable then
|
if FUpdateable then
|
||||||
|
begin
|
||||||
|
if FusePrimaryKeyAsKey then
|
||||||
begin
|
begin
|
||||||
if FusePrimaryKeyAsKey then
|
UpdateServerIndexDefs;
|
||||||
|
for tel := 0 to ServerIndexDefs.count-1 do
|
||||||
begin
|
begin
|
||||||
UpdateServerIndexDefs;
|
if ixPrimary in ServerIndexDefs[tel].options then
|
||||||
for tel := 0 to ServerIndexDefs.count-1 do
|
|
||||||
begin
|
begin
|
||||||
if ixPrimary in ServerIndexDefs[tel].options then
|
IndexFields := TStringList.Create;
|
||||||
begin
|
ExtractStrings([';'],[' '],pchar(ServerIndexDefs[tel].fields),IndexFields);
|
||||||
IndexFields := TStringList.Create;
|
for fieldc := 0 to IndexFields.Count-1 do
|
||||||
ExtractStrings([';'],[' '],pchar(ServerIndexDefs[tel].fields),IndexFields);
|
begin
|
||||||
for fieldc := 0 to IndexFields.Count-1 do
|
F := Findfield(IndexFields[fieldc]);
|
||||||
begin
|
if F <> nil then
|
||||||
F := Findfield(IndexFields[fieldc]);
|
F.ProviderFlags := F.ProviderFlags + [pfInKey];
|
||||||
if F <> nil then
|
end;
|
||||||
F.ProviderFlags := F.ProviderFlags + [pfInKey];
|
IndexFields.Free;
|
||||||
end;
|
|
||||||
IndexFields.Free;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end
|
end;
|
||||||
else
|
|
||||||
BindFields(True);
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
BindFields(True);
|
BindFields(True);
|
||||||
if not ReadOnly and not FUpdateable then
|
|
||||||
begin
|
|
||||||
if (trim(FDeleteSQL.Text) <> '') or (trim(FUpdateSQL.Text) <> '') or
|
|
||||||
(trim(FInsertSQL.Text) <> '') then FUpdateable := True;
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
DatabaseError(SErrNoSelectStatement,Self);
|
BindFields(True);
|
||||||
except
|
if not ReadOnly and not FUpdateable then
|
||||||
on E:Exception do
|
begin
|
||||||
raise;
|
if (trim(FDeleteSQL.Text) <> '') or (trim(FUpdateSQL.Text) <> '') or
|
||||||
end;
|
(trim(FInsertSQL.Text) <> '') then FUpdateable := True;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
DatabaseError(SErrNoSelectStatement,Self);
|
||||||
inherited InternalOpen;
|
inherited InternalOpen;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user