I came to an idea that since the two databases are identical, I deleted my destination table first then INSERT it with that from the other database.Here's my code.The whole thing are doing fine, except that I had notice that the size of my destination database(where myConnection points) gets bigger compared to my source database(myDB.mdb) eventhough the have very the same data after the code execution.Code:Dim myTrans As New OleDbCommand("DELETE * FROM [TRANSACTIONS]", myConnection) Dim myTransDetails As New OleDbCommand("DELETE * FROM [TRANSACTIONDETAIL]", myConnection) myConnection.Open() myTrans.ExecuteNonQuery() myTransDetails.ExecuteNonQuery() myTrans.CommandText = "INSERT INTO [TRANSACTIONS] SELECT * FROM [MS ACCESS; DATABASE=\\leah\SharedDocs\myDB.mdb;].[TRANSACTIONS]" myTransDetails.CommandText = "INSERT INTO [TRANSACTIONDETAIL] SELECT * FROM [MS ACCESS; DATABASE=\\leah\SharedDocs\myDB.mdb;].[TRANSACTIONDETAIL]" myTrans.ExecuteNonQuery() myTransDetails.ExecuteNonQuery() myConnection.Close()
I tried deleting and inserting 7 tables with an average 1000 records each and the performance is quite ok for me(about 3 seconds to complete) but I noticed that my new destination database ballooned to 85MB while my source database was just 13MB and inspecting both DB's would show that they had very identical data.Where are the excess MB's came from?Had I miss something here?thanks.




Reply With Quote