Results 1 to 3 of 3
  1. #1
    KathyL is offline Advanced Beginner
    Windows 8 Access 2007
    Join Date
    Aug 2010
    Posts
    94

    Smile Shell command to execute cmd.exe fails when database is already being used

    We just updated from Windows Server 2003 to Server2008. I’ve a process I’ve coded with VB in access which, using a ‘shell’ command to run the command prompt and startanother copy of Access, now fails, whereas it ran fine for a couple of years under server 2003.
    The new problem which is occurring, is that the database (“ItemBatch.accdb”)will start just fine if it’s standalone. But if any other user has opened it, the shell run command fails, just ‘blips’at me. It seems to know it’s opened by another process. The ItemBatch.accdb is set up for multiuser, and like I said has been running for some time with multiple users accessing it.
    The Shell command I’m using is:

    Shell "cmd.exe /c Start ""Item Batch processing"" ""F:\Access\MyFolder\ItemBatch.accdb""", vbNormalFocus

    I’m reading that it may be security policy from the first command prompt (shell) executing a 2nd command (start), and that it may not carry the same domain policy to the 2nd command. I can’t find any way to carry domain policy from one command prompt to another.


    Anyone with ideas or a resolution? Or a different approach?
    I just want to be able to execute an Access database fromwithin VB code of my primary database and it run normally.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe instantiate a class object as a New Application??

  3. #3
    KathyL is offline Advanced Beginner
    Windows 8 Access 2007
    Join Date
    Aug 2010
    Posts
    94
    We've found that we could set up a shortcut to the Access DB we want to execute. The shortcut can contain the Administrative policy. So then, we're executing a .cmd file which opens the shortcut, and the Access DB opens, runs a bunch of VB code on an open event... and at least we're back to working.

    I'm not sure this was the shortest method or cleanest method to do this, but if it will run consistently, maybe in some days, I won't care any more. LOL.

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

Similar Threads

  1. Form Button to Execute Disabled Ribbon Command
    By stwalke2 in forum Programming
    Replies: 5
    Last Post: 04-29-2013, 01:00 PM
  2. Replies: 8
    Last Post: 02-05-2013, 02:36 PM
  3. Replies: 7
    Last Post: 06-18-2012, 11:31 AM
  4. Running a shell command from a stored procedure.
    By sstrauss87 in forum SQL Server
    Replies: 3
    Last Post: 03-01-2012, 04:39 PM
  5. Execute Command Interactively
    By zephaneas in forum Programming
    Replies: 1
    Last Post: 11-08-2008, 09:56 AM

Tags for this Thread

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