Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shell App.Path & "\MyApp.exe" 1

Status
Not open for further replies.

paulepadilla

Programmer
Apr 15, 2004
14
US
I am using the following code to execute another VB6 app within another VB6 application:

Shell App.Path & "\ImportRes.exe"

Is there a better or alternative way to do this. The code above is causing me problems with ACCESS. What is the API function to spawn an executable?

Thanks,
Paul
 
How is this causing problems with Access?
Both programs are VB6 apps?

the API is
Code:
Public Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As SECURITY_ATTRIBUTES, lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
or
Code:
Public Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As SECURITY_ATTRIBUTES, lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
Public Declare Function CreateProcessAsUser Lib "advapi32.dll" Alias "CreateProcessAsUserA" (ByVal hToken As Long, ByVal lpApplicationName As String, ByVal lpCommandLine As String, ByVal lpProcessAttributes As SECURITY_ATTRIBUTES, ByVal lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, ByVal lpEnvironment As String, ByVal lpCurrentDirectory As String, ByVal lpStartupInfo As STARTUPINFO, ByVal lpProcessInformation As PROCESS_INFORMATION) As Long

Hope I've been helpful,
Wayne Francis

If you want to get the best response to a question, please check out FAQ222-2244 first
 
> How is this causing problems with Access?

It is appending nulls exponentially. The Access database goes from 1.5 meg to 2Gig in 2 hours. If I deploy the app that populates the database manually it is fine. That's why I asked for the API that launches an executable.

Thanks for your help,
Paul
 
I take it that your 2nd app get called multiple time a second type of thing?

Have you checked that your 2nd app doesn't normally insert null data even when executed manually? I don't understand how calling an app manually, via the shell, or via the WIN32 API calls would effect if NULL records are being inserted or not. Sounds like the automatic execution is just magnifying a problem that is not very noticeable when its done manually.

CreateProcess API docs

Hope I've been helpful,
Wayne Francis

If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top