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