I am running into a problem when trying to DROP a table. I get a RTE saying the table is being used by another user or another process.
The process is to print an Access table it works the first time but if you try to print immediately print the table again is when the RTE occurs. When the printing is completed I close the table and set it to nothing. I tried doing a dispose and it did not help.
A snipet of the code is below only because the process is lenghtly:
In module InquriyUpdate - Procedure PrintEntireReport_FOR
Call Call Printer_PrintDatabaseTableADO
In module Global2 - Procedure rinter_PrintDatabaseTableADO
Do all format and print Table
close and set Table to nothing
In module InquriyUpdate - Procedure PrintEntireReport_FOR
After return call procdure to Drop Table the code is below:
cnn = New OleDbConnection(PrepareDBConnectStr(AppDir & TKWINS_MDB))
cnn.Open()
cmd = New OleDbCommand("DROP TABLE tblTempPrint", cnn)
drReader = cmd.ExecuteReader
When this executes the tblTempPrint get the RTE.
That is what I think I need to check if table is open or is there something else I can use.
Thanks.
The process is to print an Access table it works the first time but if you try to print immediately print the table again is when the RTE occurs. When the printing is completed I close the table and set it to nothing. I tried doing a dispose and it did not help.
A snipet of the code is below only because the process is lenghtly:
In module InquriyUpdate - Procedure PrintEntireReport_FOR
Call Call Printer_PrintDatabaseTableADO
In module Global2 - Procedure rinter_PrintDatabaseTableADO
Do all format and print Table
close and set Table to nothing
In module InquriyUpdate - Procedure PrintEntireReport_FOR
After return call procdure to Drop Table the code is below:
cnn = New OleDbConnection(PrepareDBConnectStr(AppDir & TKWINS_MDB))
cnn.Open()
cmd = New OleDbCommand("DROP TABLE tblTempPrint", cnn)
drReader = cmd.ExecuteReader
When this executes the tblTempPrint get the RTE.
That is what I think I need to check if table is open or is there something else I can use.
Thanks.