I have a problem with a project, and i could use some help
After the use loges on the system, i want to update a field on a table, and have all the users connected on a view created by a stored procedure. I would like to be done through a service from my app server.
How can this be done;
I have created the table and the service, but i gives me 'CommandText does not return a result set.
Please advice.
I am using Delphi, on win 7
Thank you
Hello again
I forgot to mention another issue, that has to do with the active connection upon schema commands execution. I have tried to change the active connection(connectionname) on the onactivate event on the service module, but seems to ignore me. Please advice
Thank you for the reply.
Driver is ADO with SQL.
I will try to describe the scenario in more details.
After users loggs in, i want to run servise on app. server on users database - every user, connects on his own database on remote sql server. All databases have same schema.
I have a view created on the main database on sql server- holds all subscriptions, manages all authenticaitions, and hols information for databases on the server.
So, every time a user loggs in database, the view has to be updated on the main database, in order to know who is logged on and who is logged off.
The view is created throu a stored procedure, and works fine.
So i wish to call servise on app. server to acomplish that.
If I understand you right, you need to call service method from server after user has logged on.
You could do this in onDeactivate event of LoginService.
By other hand, you can use TRODBSessionManager or TDADBSessionManager. In this case sessions will be stored in DB.
I have tried to change the active connection(connectionname) on the onactivate event on the service >module, but seems to ignore me.
You should change connection in BeforeAcquireConnection event of service.
I am absolutely lost.You suggested, i should call the server method, after the user has logged on, onDeactive event of Loginservice. What method should I call, the one you suggested on you prev post(function TDAataService.NewMethod: Binary; …). or something else; In fact, i don’t need a dataset returned after the update command with the service, just call the service and have the job done.
Seems like i miss something with the services and the commands.
Is it possible to just call the update command, and finish the job, or there is always the scenario that commands should return something;
Please help me to understand.
Best regards
manosm said: Is it possible to just call the update command, and finish the job, or there is always the scenario that commands should return something;
Of course, it is possible. I just understood from your first post that you need to return result set. If you don’t, you could just call update command without any writing in data streamer and returning result from service method.
The only difference is that you should use Execute method instead of Open if you call stored procedure that doesn’t return dataset: