My application uses ADO.NET with a Jet database (Provider=Microsoft.Jet.OLEDB.4.0).
From time to time, I have to drop some tables and build them anew. Each time, the database grows larger, apparently meaning that the disk space of deleted tables is not reused.
What can I do to prevent the database from growing?
I delete a table using the following code:
Dim dbcDelete as OleDbCommand = _
New OleDbCommand("DROP TABLE tablename", myconnection)
I build a table using the following code:
Dim strQuery As String = _
"CREATE TABLE tablename (" & _
"Id INTEGER CONSTRAINT PrimInd PRIMARY KEY, " & _
"Surname CHAR, " & _
Dim dbcCreate As OleDbCommand = New OleDbCommand(strQuery, myconnection)
Note: Instead of dropping/creating tables, I have tried to delete all table rows, but it did not help: the dabase grew all the same.