473,685 Members | 3,165 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.OpenRecordse t("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.OpenRecordse t("Table1", dbOpenDynaset)
While Not rs.EOF
rs.Edit
rs!Value = "value1"
rs.Update
rs.MoveNext
Wend

Jan 16 '06 #1
2 2848
-----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:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQ8wIhIechKq OuFEgEQKoJgCfdY cDyWZxQJtjy9OdS AH0wp+ElhMAnRod
f4tr3+cjnHy8RH4 Club3tRfE
=6atx
-----END PGP SIGNATURE-----
Al**********@gm ail.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.OpenRecordse t("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.OpenRecordse t("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
1864
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 tables with identical structures, the first holds the data input for a questionnaire, the second holds the scores from the questionnaire, to move the scores I've set up 2 action queries, the first appends the record to the second table, the second action query 'updates' the results by...
4
2019
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 table needs to be fairly customized (ie, a datagrid isn't going to work). On this page, people can update a variet of records. On submit, I want to then go in and update all of the records. Normally, I'd make each form element include a runat: server and then declare it in my codebhind so I...
1
1504
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 I have updated all the records. i.e. rather than them seeing records change 1 at a time if they refreshed their page, all the records would update together in 1 go, a bit like a batch update ?
34
10831
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 that resulted in data in temp tables, I would have VBA code that wrote the results of that away to the db, either creating new records or updating existing records, whichever was relevant. This may also include deleting records. Now I generally do this by opening a recordset on the source data...
7
2331
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 discard the header and trailer but I must split the data records up and return them to an application. The complexity here is that I won't know the exact format of the files until run time. The files may or may not contain headers and trailers
0
3564
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 record per file, rather than 1000. Is there a way of adding these to the one XML file, then starting a new one when 1000 records are reached? My code is as follows: while (XmlReader != null && nodeCounter <= 1001)//(XmlReader != null) { // Create a file to write to
10
2228
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 database record quite alright and I have created an array of checkboxes, but my update loop is not working. Here is my code: /*---------This retrieves the records -------------*/ if($row_md) { do{ echo "<tr><td text align='right'>";
5
2905
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 and update the database. My question is: Is it best to do it this way, calling the update stored procedure for every update? Or should I be loading this data into a staging table, and if all goes well do the 'Real' Update. Or put this into a data adapter and update from that? The application...
2
1732
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 this. I have a database of survey coordinate points. These records are imported from a txt file, and never manually entered. Currently there are no forms at all. The first problem is that the txt file continually gets updated by a CAD program. The second problem is that there is one extra...
0
8925
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8758
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8773
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7584
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5790
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2936
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.