Joy Conner
30th April 2015, 18:33
I am being challenged to send email messages from Order entry process given certain conditions.

I am running in windows / sql which is new for me.

I wrote vbs script on Baan server. I created bat files also on baan server which are called within baan script - tdsls4102.

This worked while in development but now that I have turned it on, sometimes it works and sometimes it does not work. Seems to be related to user but yesterday, I sat with my system administrator and he confirmed that all users have read and execute privileges in the appropriate directories.

I am wondering if there are any permissions within baan application that gives permission to the run.prog().

Thanks in advance for your help.

bhushanchanda
30th April 2015, 19:38
Hi,

You can try using sql script having sqlmail command instead of a VB Script. Though, what is the email code you are using? Is it using any external application to send emails?

Joy Conner
30th April 2015, 20:27
The vbs code I wrote is attached.

Since this works for me, I'd rather solve why it is not working for the general user population.

bhushanchanda
30th April 2015, 20:39
Hi,

What you can try is, if you are to reproduce the problem, you can try to redirect the output to a text file and check if its a permission issue or not.

e.g.

run.prog ("bat_file_name", "arguments", RP_NOWAIT,"","","C:\temp\err.txt")

Also, is your SMTP server same as Baan server? If yes, you can try using localhost instead of server name.

Joy Conner
30th April 2015, 20:45
Email is on same network, different server. I'll try the error.txt. Thank you, I was not aware of additional parameters in run.prog()

Joy Conner
1st May 2015, 17:48
Update on this, on test server the output in error.txt states

"The process cannot access the file because it is being used by another process"

I'm not sure what this means and I'm not certain it applies to our live environment.

bhushanchanda
1st May 2015, 18:04
Hi,

Are you writing any file and sending it as an attachment?

Can you try using suspend(1000) right after your run.prog() to make sure the email is sent successfully before starting another instance?

Joy Conner
1st May 2015, 21:56
Update on this:

I could use RP_WAIT instead of RP_NOWAIT. I'll try this.

I am not sending files, arguments into bat file which are subsequently sent into vbs-script.

Just received emails from the application in production.

Thanks for your help.