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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a Fox Exe from inside VB gives me different

Status
Not open for further replies.

lordhawkins

Programmer
Sep 25, 2003
64
SV
I've got a VFP .exe that has been running standalone the last three years without trouble. It transfers data from another .DBF into a results table, called BHDATA.
The resulting data are displayed using an independent VB app. That has been working smmoothly.

I've created an slightly updated version of the VB program that shoots the VFP program in a Shell. The code for the button is this:

Private Sub btnExtraer2_Click()
p = Shell("f:\prueba\acbh2.exe", vbMinizedFocus)
MsgBox ("Realizada la actualización del bihoral")
cmbHier_Click
DrawReport
End Sub

CmbHier_Click is a combo box that chooses between two SQL Select commands assigning a string.
DrawReport takes that string and makes the query and then displays the data stored in BHDATA.DBF

For testing purposes, I've made a copy of BHDATA in other folder, but the data source to fill it remains the same.

When I run the Fox EXE from within the VB app, the data transfered to BHDATA are not the same that the transfered using the SAME EXE as standalone.

Some ideas why is this so?
 
From the documentation

Note By default, the Shell function runs other programs asynchronously. This means that a program started with Shell might not finish executing before the statements following the Shell function are executed.

 
In other words, try using shell and wait. Here is the FAQ:

faq222-428

Swi
 
Try using shell and wait.

faq222-428

Swi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top