472,344 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,344 software developers and data experts.

MDB file bloats while updating records

The application we are developing uses MS Access 2003 database (with
help of ADO).
We have noticed that during massive records updating the size of the
mdb file increases dramatically (from 3-4 to 200-300 Mb).
After compacting the file shrinks back to 3-4 Mb.

I have performed the following experiment. I created a test database
containing only one table with two columns (Key number, Value
text(50)).
The table contains 10 thousands records.

I have run two slightly different functions to update the table.
After running of Function 1 the mdb size is not changed significantly
(about 5-6%).
BUT if I run Function 2, database bloats from 0,5Mb to 39Mb !!!

Does anyone know why this happen?
Is it normal behavior of bynamic recordsets?

Thanks in advance,
Alexey

Function 1:
Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = CurrentDb
Set rs = db.OpenRecordset("Table1", dbOpenDynaset)
While Not rs.EOF
db.Execute ("Update table1 set [value]='value1' where [Key] = "
& rs![Key])
rs.MoveNext
Wend

Function 2:
Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = CurrentDb
Set rs = db.OpenRecordset("Table1", dbOpenDynaset)
While Not rs.EOF
rs.Edit
rs!Value = "value1"
rs.Update
rs.MoveNext
Wend

Jan 16 '06 #1
2 2731
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bloat in Access is pretty common. You might try changing your method of
updating the table. Instead of individually updating each row in the
table using a recordset you can use just one SQL qry:

db.Execute "UPDATE Table1 SET [Value] = 'value1'", dbFailOnError

This will do the same thing you've got in Function 1 & Function 2; i.e.,
update all the rows in the table.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQ8wIhIechKqOuFEgEQKoJgCfdYcDyWZxQJtjy9OdSAH0wp +ElhMAnRod
f4tr3+cjnHy8RH4Club3tRfE
=6atx
-----END PGP SIGNATURE-----
Al**********@gmail.com wrote:
The application we are developing uses MS Access 2003 database (with
help of ADO).
We have noticed that during massive records updating the size of the
mdb file increases dramatically (from 3-4 to 200-300 Mb).
After compacting the file shrinks back to 3-4 Mb.

I have performed the following experiment. I created a test database
containing only one table with two columns (Key number, Value
text(50)).
The table contains 10 thousands records.

I have run two slightly different functions to update the table.
After running of Function 1 the mdb size is not changed significantly
(about 5-6%).
BUT if I run Function 2, database bloats from 0,5Mb to 39Mb !!!

Does anyone know why this happen?
Is it normal behavior of bynamic recordsets?

Thanks in advance,
Alexey

Function 1:
Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = CurrentDb
Set rs = db.OpenRecordset("Table1", dbOpenDynaset)
While Not rs.EOF
db.Execute ("Update table1 set [value]='value1' where [Key] = "
& rs![Key])
rs.MoveNext
Wend

Function 2:
Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = CurrentDb
Set rs = db.OpenRecordset("Table1", dbOpenDynaset)
While Not rs.EOF
rs.Edit
rs!Value = "value1"
rs.Update
rs.MoveNext
Wend

Jan 16 '06 #2

I understand that just one query is enough to update all row with the
same value. But in the real application each record receives its own
individual value.
Thats why I update each record individually in my test database.

Thank you,
Alexey

Jan 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris Jackson | last post by:
I'm a novice Access user and am not sure how to solve the following problem. Any help with the following would be greatly appreciated! I have two...
4
by: Darrel | last post by:
I'm creating a table that contains multiple records pulled out of the database. I'm building the table myself and passing it to the page since the...
1
by: davidgordon | last post by:
Hi, If I am updating a list of records for a user on an asp page, is there a way to hold the page updating, even if they refresh the page, until...
34
by: Jeff | last post by:
For years I have been using VBA extensively for updating data to tables after processing. By this I mean if I had to do some intensive processing...
7
by: M | last post by:
Hi, I need to parse text files to extract data records. The files will consist of a header, zero or more data records, and a trailer. I can...
0
by: bigove | last post by:
I am trying to read an XML file and split it so that it creates a new file every 1000 records. I can read it, create a new one, but it creates 1...
10
by: chimambo | last post by:
Hi All, I have a little problem. I am retrieving records from a table and I want to update the records using checkboxes. I am able to display the...
5
by: Bill Schanks | last post by:
I have a winform app (VB 2005) that allows users to export data to excel, make updates to the excel file and import the data from that Excel file...
2
tdw
by: tdw | last post by:
Hi all, I have several ideas on how to do this, but am having difficulty putting the ideas together and figuring out the most efficient way to do...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.