Syntax of xp_cmdshell that will run a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anybody know the syntax of the 'command_string' in SQL Server's system
sp xp_cmdshell that will run an Access Report on the network?
For instance, I have a copy of Access in following location
C:\Program Files\Office 2000\Office\Access.EXE,
and another Mymdb.mdb file with a report name rptXYZ in it located in
C:\Program Files.
I am sure there is a way to fire up that report from sp or T-SQL, or a
trigger by EXEC xp_cmdshell 'some syntax help here '. I know there is
permission/security issues involved, but I would like to find an example of
the command.

Thanks!
 
Hi,
should be something like this:
xp_cmdshell '"C:\Program Files\Office 2000\Office\Access.EXE" C:\My.MDB',
NO_OUTPUT
 
What about report name? How do I pass that in, and is it possible to pass in
a where clause as well?

Thanks!
 
Report name you can pass via macro (using /x switch)
also you can pass it with commandline arguments

not sure about where clause, could be long. you can try to make some table
on sql server, where you store your where clause and then read it from
access

BTW, bit strange design is to run reports from SQL server...
 
Back
Top