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 Development (2000)
 Accessing outlook2000 via VB-exe in package in job

Author  Topic 

Mireille Sieron
Starting Member

1 Post

Posted - 2002-01-02 : 10:03:16
I work with SQL-server 7.0

The problem:
I made a program in VB, that: accesses outlook 2000 -using a profile-, reads attachment from mail in the inbox, deletes the mail after processing it and via Stored Procedures puts the data into tables on SQL-server.

The program works, when I execute the program manually on the server, where SQL-server is installed.

When I put the program in a package and create a job, executing this package; it doesn't work any more.
I use the same username, password as when I execute the program manually on the server.

The mail is not deleted and not read, so I presume there is a problem with accessing the mailbox via SQL-server.

Any suggestions?
I am most greatfull for any tips You can give me.
Mireille

royv
Constraint Violating Yak Guru

455 Posts

Posted - 2002-01-02 : 11:42:15
If you can change the VB application to be a command line app, then you can write a stored procedure to call the VB application. Be careful though, the application will run under the SQL Server memory space, and I have had my servers crash because of this.

*************************
Just trying to get things done
Go to Top of Page

Talalch
Starting Member

1 Post

Posted - 2002-01-02 : 12:40:43
Can you tell me how to call a VB application for a stored procedure
Thanks


quote:

If you can change the VB application to be a command line app, then you can write a stored procedure to call the VB application. Be careful though, the application will run under the SQL Server memory space, and I have had my servers crash because of this.

*************************
Just trying to get things done



Go to Top of Page

royv
Constraint Violating Yak Guru

455 Posts

Posted - 2002-01-02 : 15:15:11
Once you have your VB exe, all you have to do is call xp_cmdshell from your stored procedure to call the exe. xp_cmdshell is well documented in books online, but a quick example would be something like this:

create procedure spTest
as
exec master..xp_cmdshell 'c:\vb.exe'

*************************
Just trying to get things done
Go to Top of Page
   

- Advertisement -