Hi,

I need to pass additional parameter(s) to the SQL Server with ANY query executed from Access.


Be it automatic form updates or manual query execution (like CurrentDb.Execute).

Then on the SQL Server this parameter will be used in triggers (for example to identify ID of user who executed the query).

Ideally I would like to handle some ADO&DAO events and add the parameter from there.
It would allow me to avoid modification of every possible data access scenario.

This means for example, when we close Acces Form it will issue a query like "update x,y,z where a,b,c".
But the SQL server would additionally get something like this:

declare @automaticallyAddedParameterForEachQuery int
set @automaticallyAddedParameterForEachQuery=12345

update x,y,z where a,b,c

where automaticallyAddedParameterForEachQuery is the parameter I want to add.


The main purpose of all this is implementing AuditLog with triggers on the back-end side (Sql Server 2000).

Can you suggest me how I can achieve that?

Thanks,
Dmitriy.