Results 1 to 5 of 5
  1. #1
    PracticalProgram is offline Novice
    Windows 7 64bit Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    5

    Determining if program launch with /runtime option ???

    Does anyone know if it is possible to determine, in Access VBA, whether or not the program running was launched with a /runtime option in it's command line?



    I am not talking about the Command() function which only reads what was passed with the /command runtime option.

    I am talking about the other command line options (specifically the /runtime option)--can they be determined from within the program using VBA?


    Alternatively, is it possible, with VBA, to determine if a program was launched directly, or via a shortcut? I don't think this is possible but I thought I would just throw it out there.

  2. #2
    PracticalProgram is offline Novice
    Windows 7 64bit Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    5

    Just found the answer . . .

    Quote Originally Posted by PracticalProgram View Post
    Does anyone know if it is possible to determine, in Access VBA, whether or not the program running was launched with a /runtime option in it's command line?

    I am not talking about the Command() function which only reads what was passed with the /command runtime option.

    I am talking about the other command line options (specifically the /runtime option)--can they be determined from within the program using VBA?


    Alternatively, is it possible, with VBA, to determine if a program was launched directly, or via a shortcut? I don't think this is possible but I thought I would just throw it out there.


    SysCmd(acSysCmdRuntime)

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Read your post at least a couple of times and still am left wondering why you can't use the db Command property (unless you really were referring to a command function, which I've not heard of). I've used it to determine if the db was opened by a pc (not used by a person but was only for running many updates during the night) or not. If not, it was a regular person, and the difference was that the "pc" version used a shortcut with a command line switch. Anyway, you solved it and were generous enough to post your solution. Thanks!
    Last edited by Micron; 02-03-2019 at 10:59 AM. Reason: spelin and gramur
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    PracticalProgram is offline Novice
    Windows 7 64bit Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    5
    Micron, just to explain . . .
    I have a customer that does not want to have their Access application in an accde form.
    But I still want to keep as many people out of the accdb as possible.
    The next best thing to an accde is to force the user to launch the program with the /runtime command-line option.
    So, I have code executing, immediately upon invocation of the accdb, which test whether or not the program was launched with the /runtime command-line option and, if not, pops up a message box and quits the program.
    This discourages people from double-clicking on the accdb and "forces" them to double-click on a desktop shortcut which contains the /runtime command-line option.
    It is certainly not a foolproof method, but it is better than free access to the accdb.

    Ken

  5. #5
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    That's exactly what I did, and you are correct - it is the Command function, not a property of the db.
    Have to say, don't really get the opposition to accde option, but whatever floats yer boat. By any chance did you prevent use of the bypass technique that would allow me to skip your code?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 04-09-2018, 10:30 PM
  2. MS Access 2010 Runtime Program Location
    By Phil Hoop in forum Programming
    Replies: 4
    Last Post: 02-12-2018, 06:13 PM
  3. Determining if an email was sent or not
    By craig1988 in forum Modules
    Replies: 4
    Last Post: 10-25-2016, 07:00 AM
  4. Program a 30-day trial into my Access Program?
    By genghiscomm in forum Programming
    Replies: 1
    Last Post: 05-26-2011, 02:14 PM
  5. Where is my runtime program?
    By shesgone in forum Access
    Replies: 2
    Last Post: 04-02-2010, 07:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums