I need some help. I am writing an application that accesses an external exe file which is a DOS application. I am currently using the shell command to access this file. What this application does is rebuilds the tables in a FairCom Database using a modified version of the standard rebuild function. The problem is when I goto do a rebuild of all the tables I have a Do loop which opens up the rebuild application and gets passed the name of the table. The VB application is basically just a GUI for the DOS application. Here is my sample of code. I hope it explains better what I am trying to do.
Private Sub cmdBegin_Click()
Dim MaxListitem
MaxListitem = cboTableName.ListCount - 1 'Gets the total number of tables in the DB
If chkAllTables.Value = 1 Then 'Checks if the user wants a rebuild of all the tables.
PrgCom.Max = MaxListitem 'Max property for a progress bar
Do Until cboTableName.ListIndex = MaxListitem 'loops through all the tables
Call RunRebuild ' calls the rebuild
cboTableName.ListIndex = cboTableName.ListIndex + 1 'moves to the next table
PrgCom.Value = PrgCom.Value + 1 'increases the progress bar
Loop
Else
RunRebuild ' used if rebuilding only one table
End If
End Sub
____________________________________________________________
Private Sub RunRebuild()
Dim validation As Boolean
Dim NewSting As String
Dim Runrbld As String
Dim Pathtocheck As String
validation = False
Pathtocheck = ""
NewString = "C:\Work\Clin\Util\csrbld.exe" + " C:\Work\Clin\jk_tech " + cboTableName.Text + " >>rebuild.log" ' the path csrbld [schema] [tablename]
Runrbld = Shell(NewString, vbNormalFocus) 'runs the app
Loop
End Sub
____________________________________________________________
Private Sub DisplayLog()
Do Until EOF(1)
Input #1, Outy
txtOutput.Text = txtOutput.Text + Outy + vbCrLf
Loop
End Sub
The problem I am having is that it opens up 130 instances of the database rebuild, one for each table. What I want it to do is wait till the first rebuild is finished to do the second. I need some sort of check, anyone have any idea's.




Reply With Quote