cj92713696
Programmer
In the below example, if I don't issue a 10 second pause after the delete query and attempt to add data w/o this pause, I get duplicate entries. It's like SQL Server isn't finished deleting data when I attempt to append. Am I doing something wrong?
Thanks,
CJ
dbConn.Open DE.fatsales_SQL.ConnectionString
dbConn.Execute "DELETE FROM " & strTableName & " WHERE " & strTableName & _
".StoreCode = '" & strStoreCode & "' AND " & strTableName & ".Date >= #" & _
Format(startDate, "mm/dd/yyyy" & "# AND " & strTableName & ".Date <= #" & _
Format(endDate, "mm/dd/yyyy" & "#"
GlobalAccess.addServiceHistory "Command issued at - " & Format(Now, "hh:mm:ss"
frmService.txtCmdStatus.Text = dbConn.State
While dbConn.State = adStateExecuting Or _
dbConn.State = adStateConnecting Or _
dbConn.State = adStateFetching
frmService.txtCmdStatus.Text = dbConn.State
Wend
frmService.txtCmdStatus.Text = dbConn.State
GlobalAccess.addServiceHistory "Command completed at - " & Format(Now, "hh:mm:ss"
dbConn.Close
GlobalAccess.addDbHistory _
strStoreCode, _
"Microsoft Access database (*.mdb) delete; table: " & strTableName & _
", store code: " & strStoreCode & ", start date: " & startDate & _
", end date: " & endDate
GlobalAccess.addServiceHistory _
"(tbl: " & strTableName & " Pause to allow cached data to flush; 10 secs."
startTime = Now
While Utils.wait(startTime, 10) = True
Wend
Thanks,
CJ
dbConn.Open DE.fatsales_SQL.ConnectionString
dbConn.Execute "DELETE FROM " & strTableName & " WHERE " & strTableName & _
".StoreCode = '" & strStoreCode & "' AND " & strTableName & ".Date >= #" & _
Format(startDate, "mm/dd/yyyy" & "# AND " & strTableName & ".Date <= #" & _
Format(endDate, "mm/dd/yyyy" & "#"
GlobalAccess.addServiceHistory "Command issued at - " & Format(Now, "hh:mm:ss"
frmService.txtCmdStatus.Text = dbConn.State
While dbConn.State = adStateExecuting Or _
dbConn.State = adStateConnecting Or _
dbConn.State = adStateFetching
frmService.txtCmdStatus.Text = dbConn.State
Wend
frmService.txtCmdStatus.Text = dbConn.State
GlobalAccess.addServiceHistory "Command completed at - " & Format(Now, "hh:mm:ss"
dbConn.Close
GlobalAccess.addDbHistory _
strStoreCode, _
"Microsoft Access database (*.mdb) delete; table: " & strTableName & _
", store code: " & strStoreCode & ", start date: " & startDate & _
", end date: " & endDate
GlobalAccess.addServiceHistory _
"(tbl: " & strTableName & " Pause to allow cached data to flush; 10 secs."
startTime = Now
While Utils.wait(startTime, 10) = True
Wend