mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 20:19:25 +02:00
* Allow searching and filtering on ftFixedWidth fields
* Improved error message for fieldtypes for which searching and filtering are not available git-svn-id: trunk@14787 -
This commit is contained in:
parent
52e803112b
commit
00f42cbdf1
@ -1323,7 +1323,7 @@ end;
|
||||
procedure TBufDataset.ProcessFieldCompareStruct(AField: TField; var ACompareRec : TDBCompareRec);
|
||||
begin
|
||||
case AField.DataType of
|
||||
ftString : ACompareRec.Comparefunc := @DBCompareText;
|
||||
ftString, ftFixedChar : ACompareRec.Comparefunc := @DBCompareText;
|
||||
ftSmallint : ACompareRec.Comparefunc := @DBCompareSmallInt;
|
||||
ftInteger, ftBCD : ACompareRec.Comparefunc :=
|
||||
@DBCompareInt;
|
||||
@ -1334,7 +1334,7 @@ begin
|
||||
@DBCompareDouble;
|
||||
ftLargeint : ACompareRec.Comparefunc := @DBCompareLargeInt;
|
||||
else
|
||||
DatabaseErrorFmt(SErrIndexBasedOnInvField, [Fieldtypenames[AField.DataType]]);
|
||||
DatabaseErrorFmt(SErrIndexBasedOnInvField, [AField.FieldName,Fieldtypenames[AField.DataType]]);
|
||||
end;
|
||||
|
||||
ACompareRec.Off1:=sizeof(TBufRecLinkItem)*FMaxIndexesCount+
|
||||
|
@ -373,7 +373,7 @@ begin
|
||||
|
||||
// define field in parser
|
||||
case FieldInfo.DataType of
|
||||
ftString:
|
||||
ftString, ftFixedChar:
|
||||
begin
|
||||
TempFieldVar := TStringFieldVar.Create(FieldInfo);
|
||||
TempFieldVar.FExprWord := DefineStringVariable(VarName, TempFieldVar.FieldVal);
|
||||
@ -405,7 +405,7 @@ begin
|
||||
TempFieldVar.FExprWord := DefineDateTimeVariable(VarName, TempFieldVar.FieldVal);
|
||||
end;
|
||||
else
|
||||
raise EDatabaseError.CreateFmt(SErrIndexBasedOnInvField, [VarName]);
|
||||
raise EDatabaseError.CreateFmt(SErrIndexBasedOnInvField, [VarName,Fieldtypenames[FieldInfo.DataType]]);
|
||||
end;
|
||||
|
||||
// add to our own list
|
||||
|
@ -36,7 +36,7 @@ Resourcestring
|
||||
SErrTransAlreadyActive = 'Transaction already active';
|
||||
SErrTransactionnSet = 'Transaction not set';
|
||||
SErrIndexResultTooLong = 'Index result for "%s" too long, >100 characters (%d).';
|
||||
SErrIndexBasedOnInvField = 'Field "%s" is an invalid field type to base index on.';
|
||||
SErrIndexBasedOnInvField = 'Field "%s" has an invalid field type (%s) to base index on.';
|
||||
SErrIndexBasedOnUnkField = 'Index based on unknown field "%s".';
|
||||
SErrConnTransactionnSet = 'Transaction of connection not set';
|
||||
SErrNotASQLConnection = '"%s" is not a TSQLConnection';
|
||||
|
Loading…
Reference in New Issue
Block a user