* 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:
joost 2010-01-23 23:21:47 +00:00
parent 52e803112b
commit 00f42cbdf1
3 changed files with 5 additions and 5 deletions

View File

@ -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+

View File

@ -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

View File

@ -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';