Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Problem with CMCExec Job in SQL Agent

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-10-14 : 12:57:10
Heather writes "I have created an EXE in VB 6.0 that does the following - (I know, this doesn't sound like a SQL Server question yet, but bear with me, I promise it is!) it polls a specific MAPI mailbox for a specific attachment to an email. When it finds this attachment (a delimited text file with a specific format), it saves it to the hard disk. It then calls (using a shell command) dtsrun to run a DTS package on my SQL Server (7.0 SP2) to append the text file contents to an existing table. The file on the hard drive is then deleted. The program then uses ADO to call a stored procedure on the same SQL Server that processes the new data.

My objective is to use SQL Agent to run this program every four hours or so to catch any email messages and process them automatically. However...

When I run this EXE program on the system with the SQL Agent installation I want to use (not the same server as the SQL Server with the data - same version and SP though - also this server has an ODBC DSN for the data server and the SQL Agent user has full permissions on that server and the database being used) it works great. But when I create the job using a cmdexec step in SQL Server Agent and run it, it just hangs there. It says it is executing, but does not perform any of the tasks (file creation on the hard drive, etc.) and does not appear in Task Manager. SQL Server Agent will, however, allow me to stop execution.

Again, both systems are using SQL Server 7.0 SP2 and NT 4.0 SP 6.

Any thoughts? I have a feeling I'm missing something obvious, but I can't see it.

Thanks so much!"
   

- Advertisement -