I am able to download and import one text file into sqlLite but am having difficulty downloading and processing multiple files sequentially from the same MenuItem_Click event because, it appears, the sub has to complete and exit before the httpjob Job Done is called. I can do one table or the other but will only process the last one when calling sequentially. I was hoping to call
Sub RcvUpdate_Click
SyncTable("wcJobLog")
SyncTable("wcUdfAsTbl")
End Sub
Which would call:
*This calls a web service to create a text file
downloadCSV.Initialize("CSV",Me)
downloadCSV.Download(strGet)
Which then waits for the download to complete and then calls JobDone:
Sub JobDone (job As HttpJob)
If job.Success = True Then
Select job.JobName
Case "CSV"
*This Downloads the file after it's been created
HandleCSV(job)
Case "csvfile"
*This imports the file into the sqlLite db
HandleFile(job)
End Select
Else
Log("Login failed :" & job.ErrorMessage)
ToastMessageShow("Failed to communicate with Server", True)
End If
job.Release
End Sub
How can I accomplish downloading and processing multiple files?