Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter string problems - anyone help?

Status
Not open for further replies.

109driver

Technical User
Jul 24, 2001
3
GB
I' m having a problem with a filter on a query dataset and wondered if anyone would be kind enough to help.
I want to be able to find all processes started or finished by particular users on selection of the user name.

The problem seems to be connected with the following piece of code -

XUserName := QUserList.FieldValues['UserName'];

QProcess.Filter := 'User = ' + QuotedStr(XUserName ) + ' or ' + ''User _1 = ' + QuotedStr(XUserName );

When I run this the following error message is displayed;

"Project Tester.exe raised exception class EDBEngineError with message ‘Operation not applicable’. Process stopped. Use Step or Run to continue."

XUserName is a global variable. I've tried some fairly extensive debugging and the error seems to be resident in the "QProcess.Filter..." line.
Now, the problem is that the syntax checker doesn't seem to think there is anything wrong with this line so I can only conclude I'm trying to do something that the BDE doesn't like.

The text of the SQL is;
"SELECT ProcessTable.ProcessNo, ProcessTable.Date, ProcessTable.UserID, UserTable.UserName, ProcessTable.StartDate, ProcessTable.FinishUser, UserTable_1.UserName, ProcessTable.FinishDate FROM UserTable AS UserTable_1 RIGHT JOIN (UserTable INNER JOIN ProcessTable ON UserTable.IndexUser = ProcessTable.UserID) ON UserTable_1.IndexUser = ProcessTable.FinishUser ORDER BY ProcessTable.ProcessNo, ProcessTable.Date, UserTable.UserName"

No problems with this - connected to a DbGrid it displays the correct data when a manual process I've got as a check is used.

The Process Table records various details about a number of business processes in a workflow environment such as Process Number, Date Started and the name of the User who started/finished a particular process. The same user isn't allowed to start and finish the same process, hence the need to connect the User Table in two seperate joins.

For additional info. both tables are (at present) on a local database (MS Access).

Any ideas?
 
have you looked up filter in the help?
maybe its a read only variable ???

just a thought, BobbaFet

Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com

&quot;<beer brand> is like making love in a cano...
it's <f-word + ing> close to water !!!&quot;
- Monty Python's Flying Circus, 1969/70
 
Dear BobbaFet

thanks for the rapid response.
The Filter can definitely be set at design or run-time and in fact the following works fine;

QProcess.Filter := 'User = ' + QuotedStr(XUserName);

Unfortunately, as there are two instances of &quot;User&quot; which I have to retrieve the above isn't much use to me on its own.

regards



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top