Force access to use a real app name

  • I have an hidden recursing bug in one of 10 ADPs (20+ users). I need to do some auditing for every transaction made on 1 table to find out what and WHERE the problem can be.

    The problem is when I use APPNAME() I always get ""Microsoft® Access"". I tried going through the connections wizard's options and set the APPNAME to something more telling like billing.adp or clients.adp... Everything works fine when I test the connection string (the trace shows the new application name as it should) but as soon as I hit ok and start using the ADP the APPNAME goes back to ""Microsoft® Access"".

    I've tried every workaround I can think of to reset the connection manually but the APPNAME is never saved in the ConnectionString property (I've even tried rebuilding and adp from scratch by copying every object / references in a new adp and setting the connection then but I still get the same problem, even when giving the modified version of the connection string that access uses (including appname obviously) instead of the base connection created by the DataLink wizard).

    Has anyone ever found a way to go around this problem?

  • CurrentProject.Name will return the name of the file, or if you have given the application a title in the startup dialog box then

    currentproject.Properties("AppTitle") will return this

  • I am assuming your access db is connecting to sql server from your post and that you use a a connection string rather than the link table manager.

     

    If so you can use 

    app="appname";

    When you look in enterprise manager you will see the appname appear.


    ------------------------------
    The Users are always right - when I'm not wrong!

  • In answer to WSquared's comment, I'm using appname() on sqlserver in a trigger so any access options are off.

    IN answer to Jonathan Stokes :

    This is an ADP connected directly to Sql Server (not linked tables).

    If you hit the menu File / connection... you'll see a datalink to connect to sql server. Under the "All" tab you'll see the option Application name. When I put 'MyADP.ADP' and then go back and hit test connection and watch this from a trace the application name used to test the connection is 'MyADP.ADP'. But as soon as I hit ok an open a form (or anything that connects to sql server) the appname is rechanged to 'Microsoft® Access' instead of 'MyADP.ADP'.

    Unfortunately I haven't found a way to set the connection string of currentproject.connection manually (tried openconnection and all the properties (all usefull properties are read-only) I could find, but openconnection method always remodify the connection string to meet some sort of MS standards that I can't explain. I've also tried using the modified string that access creates in the openconnection method (appending ";application name = test.adp" to the string but it gets remodified anyways).

    Has anybody a clue on how to set the application name property of ACCESS 2000's connection string (even if I create my own connection access will keep using it's own for 75% of the tasks so it doesn't help a lot for my logging)?

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply