by GaryVass » Wed Feb 29, 2012 9:29 pm
The only GUI part is the user clicks a button to start the process... there is no other gui interaction after that. All variables declared as Public, all subs declared as public. (the module is mdeInput.module, and the sub is Public Sub ImportIt(tDataTick As String) .... I named it wrong in the last post...)
This is the code for the button under MainWindow.QMainWindow :
Signal on_cmdSP500Data_clicked(Checked As Boolean)
SPMktCap = 0
'generate basic data in SPDATA1 recordset
strSQL= "DELETE FROM SPDATA1;"
rslt = Query.Run(strSQL)
If rslt = 0 Then
MsgBox("Warning1", "Error: Table SPDATA1 was not cleared")
End If
strSQL= "DELETE FROM SPVal;"
rslt = Query.Run(strSQL)
If rslt = 0 Then
MsgBox("Warning1", "Error: Table SPVal was not cleared")
End If
strSQL = "SELECT * FROM SPTIC ORDER BY TIC;"
sRecordsId = Records.Open(gsDatabase, strSQL)
stocknum = (Records.Length(sRecordsId))
rGo2= 0
REPORT = "SPDATA1"
Do While stocknum > 0
DFoundIt = 1
Records.GoTo(sRecordsId, rGo2)
DataTick = Records.Value(sRecordsId, "TIC")
sSector = Records.Value(sRecordsId, "SECTOR")
sSPCode = Records.Value(sRecordsId, "SPCode")
rGo2= rGo2 + 1
GetData(DataTick)
sdir = "c:/naic/"
filename = sdir + DataTick + ".ssg"
MsgBox("filename:", filename)
tDataTick = filename
mdeInput.ImportIt(filename) THIS IS WHERE THE CRASH OCCURS, AS SOON AS THIS IS CALLED. I PUT SOME MSGBOX IN THE SUB JUST AT THE BEGINNING, BUT THEY ARE NEVER DISPLAYED, SO I DONT THINK THE CODE ACTUALLY GETS TO THE SUB ROUTINE
MsgBox("dataList:", dataList)
MsgBox("DFoundIt = ",DFoundIt)
If DFoundIt = 1 Then
mdeDataImport.StockData(filename, REPORT, DataTick)
stocknum = stocknum - 1
End If
Loop