Problems with supporting Yaffil and CalcField char(1)
Posted: Tue 26 Jun 2007 16:03
Yaffil IB clone have version string like "WI-1.3.XXX...", but FireBird version string looks like "WI-V2.0.1.XXXXX".
During preparation of query under Yaffil thrown exception "'.' is not a valid integer value".
Corrected code of GetMajorServerVersion function in unit IBCClasses.pas:
Second problem is calculated field type string(1).
Fill any legal select query in IBCQuery. Add all fields as persistent in fields editor and create new calculated field type string with size 1.
Write OnCalcFields event like:
Connect query with DataSource and DBGrid. Break point in debugger on body of CalcFields procedure successfully executed, but DBGrid don't show "*" in corresponded column.
Any combination of Options property of IBCQuery cannot solve this problem. But calculated field type char(2) works fine!
Delphi 7 and IBDac 2.10
Sorry for my "english"!
During preparation of query under Yaffil thrown exception "'.' is not a valid integer value".
Corrected code of GetMajorServerVersion function in unit IBCClasses.pas:
Code: Select all
function TGDSConnection.GetMajorServerVersion: integer;
var
VersionString: string;
DotPos: Integer; // *** New line
begin
if FMajorServerVersion = 0 then begin
if IsFBServer then
VersionString := FDatabaseInfo.FBVersion
else
VersionString := FDatabaseInfo.Version;
if Length(VersionString) >= 7 then begin
{*** Old code
FMajorServerVersion := StrToInt(VersionString[5]);
FMinorServerVersion := StrToInt(VersionString[7]);
}
// *** Start of new code
DotPos := Pos('.', VersionString);
if (DotPos > 1) and (DotPos < Length(VersionString)) then begin
FMajorServerVersion := StrToInt(VersionString[DotPos - 1]);
FMinorServerVersion := StrToInt(VersionString[DotPos + 1]);
end;
// *** End of new code
end;
end;
Result := FMajorServerVersion;
end;
Fill any legal select query in IBCQuery. Add all fields as persistent in fields editor and create new calculated field type string with size 1.
Write OnCalcFields event like:
Code: Select all
procedure TForm1.IBCQuery1CalcFields(DataSet: TDataSet);
begin
with DataSet do
FieldByName('FIELD1').AsString := '*';
end;
Any combination of Options property of IBCQuery cannot solve this problem. But calculated field type char(2) works fine!
Delphi 7 and IBDac 2.10
Sorry for my "english"!