473,322 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Access Database size

I am using access database for my application, whenever I insert records the
size of the data base increases, But when I delete the records the database
size does not decrease. What is the problem???
ThanX
Nitin
Nov 21 '05 #1
3 2746
Access does not self-shrink. You can do it manually, i.e., compact &
repair, or do it from code from another application. Please look in the
access newsgroups for assistance.

hth
Eric
Nitin wrote:
I am using access database for my application, whenever I insert
records the size of the data base increases, But when I delete the
records the database size does not decrease. What is the problem???
ThanX
Nitin

Nov 21 '05 #2
Hi,

Compact and repait the database. Add a reference to the microsoft
jet and replication objects in the com tab.

Dim jro As New JRO.JetEngine

Dim fl As File

Dim strSource As String

Dim strConn As String

Dim strDest As String

Dim strDay As String

Dim drDest As Directory

strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"

strConn += "Data Source = "

strSource = Application.StartupPath

strDest = strSource

strSource += "\test.mdb"

strDest += "\test.bak"

If fl.Exists(strDest) Then

fl.Delete(strDest)

End If

Try

jro.CompactDatabase(strConn + strSource, strConn + strDest)

fl.Copy(strDest, strSource, True)

Catch

fl.Copy(strSource, strDest, True)

Finally

fl.Copy(strDest, strSource, True)

jro = Nothing

End Try
Ken
--------------------------------
"Nitin" <lo*******@yahoo.com> wrote in message
news:uZ**************@TK2MSFTNGP15.phx.gbl...
I am using access database for my application, whenever I insert records the
size of the data base increases, But when I delete the records the database
size does not decrease. What is the problem???
ThanX
Nitin

Nov 21 '05 #3
Hi Nitin,

The posts by Eric and Ken are right, repair and compact is the answer to the
"what do I do" portion of your question. As to the "why does this happen"
part, most database packages do not do a physical delete when a "DELETE" SQL
statement comes in. Rather, the records to be deleted are marked with a
"tombstone" that indicates that they are logically deleted. To physically
remove them, a "shrink" operation needs to be invoked. In the case of
Microsoft Access, that is taken care of by the Repair (reindex) and Compact
(physically remove all records marked for deletion).

HTH,
Derrick

"Nitin" <lo*******@yahoo.com> wrote in message
news:uZ**************@TK2MSFTNGP15.phx.gbl...
I am using access database for my application, whenever I insert records the size of the data base increases, But when I delete the records the database size does not decrease. What is the problem???
ThanX
Nitin

Nov 21 '05 #4

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

Similar topics

3
by: Nicola | last post by:
Hi Everyone, I am new to programming and would like to know how to open an access Report from within vb 6. I am trying to write a program to organise cross stitch threads. I have found out how...
63
by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather write it using Visual Studio .Net? Is it as easy...
14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
28
by: deko | last post by:
After doing a lot of vba work, I've noticed the size of my mdb has grown, even though no data or objects have been added. I've read that the following procedure will remedy this and improve...
35
by: deko | last post by:
Do I get more scalability if I split my database? The way I calculate things now, I'll be lucky to get 100,000 records in my Access 2003 mdb. Here some math: Max mdb/mde size = 2000 x 1024 =...
0
by: TheCoder | last post by:
I am making a D-base with web conectivity for my class project. I have everything working but the subit button sends the data to the correct fields but afterwards it wants to reproduce new blank...
1
by: Abareblue | last post by:
I have no clue on how to insert a record into access. here is the whole thing using System; using System.Drawing; using System.Collections; using System.ComponentModel;
3
by: Knick via AccessMonster.com | last post by:
I am novice to MS Access Development, I regularly back my access database every 2, 3 days ...today when I was going to back my database I saw the access file on the network drive was only 9 MB...
1
by: Brit | last post by:
I have an ASP file that retrieves names from an Access database for 4 different categories of membership, which the visitor to the page selects (corporate, institutional, regular, or student). The...
6
by: Wesley Peace | last post by:
I hate to cross post, but I've gotten no answer yet on a problem I'm having with visual studio 2008. I've created a series of forms with controls to access a Access database tables. The...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.