cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1994
Views
0
Helpful
3
Replies

Start MS Access and run macro thru Tidal

Bill Slobodnik
Level 1
Level 1

   I am trying to convert a windows scheduled task that starts MS access and then runs a macro to run in Tidal.   The scheduled task is built to start Access using the "start a program" option: "C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE".   The "Add arguements" section contains the  operation to run "C:\file path\xxx Customer Query.accdb" /cmd "xxx".

Has anyone set up something similar for Tidal? Any pointers is appreciated.

1 Accepted Solution

Accepted Solutions

Marc Clasby
Level 1
Level 1

For a Windows Server (I am also assuming you are using a windows Agent) I see a couple of solutions and depending on your needs

Assumptions

  • Powershell installed on modern O/S
  • Powershell installed is same version
  • Powershell remoting is enabled on Target server
  • = Target Server Global Variable (could also be Group to expand use as template)
  • is the name of the task running on the server
  • TAGENT.ini has the setting to contol quote behavior single ' and double " [config] substticks=n  <-- this sometimes interferes with Tidal's ability to execute powershell code with quotes in parameters

1.) you can use Powershell to Run the Windows Scheduled Task by Name

Invoke-Command -ComputerName -Scriptblock {SCHTASKS /RUN /S /TN ""}  The problem is this is kind of a blind operation...(The Catch)

2.) you can use Powershell to run the MSAccess program directly with params in -scriptbloclk { section } something like this

"C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE C:\file path\xxx Customer Query.accdb" /cmd "xxx"

You would have to verify this works manually or apply some other solution (The Catch)

If you struggle I would add the code you see to an autoexec macro in the access program and then call it directly (MS Sccess will open run the macro manually). This might be more desireable for a number of reasons.

The Catch: How do you know you were sucessful? Does it produce a file? if not you may want to have it write somehting out that you can use as a file dependecy on a downstream job, a second job in this group could then tag the file lets say with datetime so you have know when it ran.

Hope this helps!

Marc

View solution in original post

3 Replies 3

Marc Clasby
Level 1
Level 1

For a Windows Server (I am also assuming you are using a windows Agent) I see a couple of solutions and depending on your needs

Assumptions

  • Powershell installed on modern O/S
  • Powershell installed is same version
  • Powershell remoting is enabled on Target server
  • = Target Server Global Variable (could also be Group to expand use as template)
  • is the name of the task running on the server
  • TAGENT.ini has the setting to contol quote behavior single ' and double " [config] substticks=n  <-- this sometimes interferes with Tidal's ability to execute powershell code with quotes in parameters

1.) you can use Powershell to Run the Windows Scheduled Task by Name

Invoke-Command -ComputerName -Scriptblock {SCHTASKS /RUN /S /TN ""}  The problem is this is kind of a blind operation...(The Catch)

2.) you can use Powershell to run the MSAccess program directly with params in -scriptbloclk { section } something like this

"C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE C:\file path\xxx Customer Query.accdb" /cmd "xxx"

You would have to verify this works manually or apply some other solution (The Catch)

If you struggle I would add the code you see to an autoexec macro in the access program and then call it directly (MS Sccess will open run the macro manually). This might be more desireable for a number of reasons.

The Catch: How do you know you were sucessful? Does it produce a file? if not you may want to have it write somehting out that you can use as a file dependecy on a downstream job, a second job in this group could then tag the file lets say with datetime so you have know when it ran.

Hope this helps!

Marc

Thanks Marc, this is very helpful.

I have a PS script working two thirds of the way so far (will open Access and the Database), right now trying to get PS to interpret the /cmd "xxx" portion to actually kick off the macro.  

When the macros completes there is an email that gets generated that I could leverage as a completion trigger.

I was able to complete the job automation using a .bat script (yeah, old school I know), I also needed to add the reg key JobUseDefDesktop and check the "For UNIX, source user's profile" option to force access opening an the default desktop and the macro command to run correctly.