Writing MacroExpression is not implemented

Hello

I got this message when using macros in dynamic where. My code reaches Relativity Sever. Below is the code;

with tbl_Test,DynamicWhere do begin Expression:=NewBinaryExpression( NewMacro('Copy(Name,1,3)'), NewConstant('Glu'), dboEqual); end; tbl_Test.Open;

I wonder which drivers support MacroExpressions and is there any workaround?

Thanks in advance
-Davut

Hello,

Relativity is a .NET server. Unfortunately it is not allowed to use MacroExpression in dynamic where for .NET servers. Wiki article quote:

"Please note that a WhereExpression containing a MacroExpression cannot be used to perform Dynamic Where clauses due to security restrictions (allowing it would enable SQL injection attacks via Dynamic Where).

Instead, you can provide a custom DataService method that accepts the WhereExpression parameter and converts it into SQL using the ToSqlString method. " (http://wiki.remobjects.com/wiki/MacroExpression_Class)

In the case of Relativity server you couldn’t implement proposed workaround, because it is not possible to create services for it.

So you could either implement custom Delphi server and use MacroExpression without any restrictions or implement custom .NET server with proposed workaround.

Best regards

Thank you for your explanation.