Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello great minds! Happy new year to all!

Once again I come to you for help. I was asked to make some changes to an existing vb6 set a apps where the main app, triggers the other ones in sequence and depending on each previous app results, and for this purpose, each .exe is invoked using the CreateProcess API.

Our new "child" .exes are failing to open connections to any of our DB servers; we get an "Unknown error" message from the Provider. We have successfully tested our connection strings, objects, etc. Even the child .exe(s) works perfectly when executed by themselves or when triggered by the SHELL command.

Is there any parameter we should be passing to the CreateProcess command to allow children processes to open DB connections? where is the catch? What´s is the difference between CreateProcess and Shell commands?

Thank you all very much for your guidance and may this new year bring you many opportunities for success!

Alex.
Posted

Is your main app running under the same user account as your "Child".exes? Please give us an example of the connection strings you are using for your database.
Is your main app run from a scheduled job or a windows service? If yes with what account.
With some accounts (for instance "Local System") it will not be possible to make a network connection to your database server, if said server isn't on the same machine.

Best Regards,
Manfred
 
Share this answer
 
Hello Manfred,

Thank you for you contribution; connection strings are standard, and the are 100% operational "child .exe(s) works perfectly when executed by themselves or when triggered by the SHELL command."

The Main app is run manually by the user who not only has full administrative privileges on the machine, but also is a Domain Administrator. Child .exe(s) are run with the current user account. Anyhow, I asked the management for the reason of this architecture, and since they could offer a logical answer, I merged the two offending child .exe(s) into the main app, thus solving the problem.

Once again, thank you for your contribution.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900