473,659 Members | 2,987 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A2003 Slow in Shuting Down BE ldb

I'm having a vexing problem with using filecopy and compactdatabase on a
Jet back end I'm sure I did not have with A97. It seems to me that
A2003 is much slower in shutting down the back end ldb than A97 and the
code below (for compactdatabase ) gets caught and throws an error related
to the BE still being open.

I would really appreciate any suggestions. I first ran into this with
FileCopy and settled on a warning to close all forms first and then the
user has to again choose a menu item to do the function.

Here's the code. I leave out the code for the fGetLinkPath function
which I believe I got from the Access Web & Dev Ashish. I do include
the fCloseAll function (closes open forms) and the actual function
performing the compact. The error is thrown at the line
"CompactDatabas e strNew, strCompact" in the last function below and
indicates the back end is still open:

Function fCompactBe()

Dim strPath As String

If MsgBox("This will close all screens and optimize (compact) your
data file" & vbCrLf & vbCrLf & _
"Continue?" , vbQuestion + vbOKCancel, "Shut Down and Optimize
Data File?") = vbCancel Then GoTo Exit_Proc

fCloseAll

strPath = fGetLinkPath("T BL_GAME")

fCompactDataFil e strPath

DoCmd.OpenForm "frmsetup", acNormal

Exit_Proc:

Exit Function

End Function

Function fCloseAll() As Boolean

'Closes all forms, getting rid of any connections
'to the back end

Do While Access.Forms.Co unt > 0

DoCmd.Close acForm, Forms(0).Name

Loop

End Function

Function fCompactDataFil e(strNew As String)

'strNew is path to back end

Dim strCompact As String

'first designate strCompact as the newpath with a wierdname:

strCompact = Left(strNew, (Len(strNew) - 3)) & "_COMPACT.m db"
'renames whatever.mdb to whatever_COMPAC T.mdb

CompactDatabase strNew, strCompact

FileCopy strCompact, strNew 'copy over new file with successfully
compacted one

Kill strCompact

End Function
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #1
3 1608
Have you tried DBEngine.Idle before trying to copy the file?

On Sun, 30 Jan 2005 21:55:55 -0330, Tim Marshall
<TI****@PurpleP andaChasers.Moe rtherium> wrote:
I'm having a vexing problem with using filecopy and compactdatabase on a
Jet back end I'm sure I did not have with A97. It seems to me that
A2003 is much slower in shutting down the back end ldb than A97 and the
code below (for compactdatabase ) gets caught and throws an error related
to the BE still being open.

I would really appreciate any suggestions. I first ran into this with
FileCopy and settled on a warning to close all forms first and then the
user has to again choose a menu item to do the function.

Here's the code. I leave out the code for the fGetLinkPath function
which I believe I got from the Access Web & Dev Ashish. I do include
the fCloseAll function (closes open forms) and the actual function
performing the compact. The error is thrown at the line
"CompactDataba se strNew, strCompact" in the last function below and
indicates the back end is still open:

Function fCompactBe()

Dim strPath As String

If MsgBox("This will close all screens and optimize (compact) your
data file" & vbCrLf & vbCrLf & _
"Continue?" , vbQuestion + vbOKCancel, "Shut Down and Optimize
Data File?") = vbCancel Then GoTo Exit_Proc

fCloseAll

strPath = fGetLinkPath("T BL_GAME")

fCompactDataFil e strPath

DoCmd.OpenForm "frmsetup", acNormal

Exit_Proc:

Exit Function

End Function

Function fCloseAll() As Boolean

'Closes all forms, getting rid of any connections
'to the back end

Do While Access.Forms.Co unt > 0

DoCmd.Close acForm, Forms(0).Name

Loop

End Function

Function fCompactDataFil e(strNew As String)

'strNew is path to back end

Dim strCompact As String

'first designate strCompact as the newpath with a wierdname:

strCompact = Left(strNew, (Len(strNew) - 3)) & "_COMPACT.m db"
'renames whatever.mdb to whatever_COMPAC T.mdb

CompactDatabase strNew, strCompact

FileCopy strCompact, strNew 'copy over new file with successfully
compacted one

Kill strCompact

End Function


Nov 13 '05 #2
Steve Jorgensen wrote:
Have you tried DBEngine.Idle before trying to copy the file?


Thanks, Steve, no I haven't - I've never heard of this... I'll see what
I can find in help.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #3
Steve Jorgensen wrote:
Have you tried DBEngine.Idle before trying to copy the file?


No, that did not work. 8( I tried

Access DBEngine.Idle (bothe with and without dbRefreshCache)

in front of the compactdatabase command and also immediately after the
function which closes forms and I still threw 3356 "you attempted to
open a database that is already opened exclusively by user 'ADMIN' on
machine '<my machine name>'. Try agains when the database is available."

This is a single user app, as well, not a multi user. The back end will
most likely always be on the same machine.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Nov 13 '05 #4

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

Similar topics

12
2631
by: Neil | last post by:
I previously posted re. this, but thought I'd try again with a summary of facts. I have an Access 2000 MDB with a SQL Server 7 back end. There is a view that is linked to the database via ODBC and has been in place for several years without any performance problems. Recently I added a couple of fields to the output of the view, and it became very slow when scrolling. When just opened in the database window, the linked view takes about...
0
1066
by: Tim Marshall | last post by:
I'm "exploring" A2003 right now and am pretty frustrated (Up until now, I've been an A97 only user). The improved security feature which interrogates the user as to whether s/he wants to open an app is really stupid. I searched google for this and in a thread last february (http://tinyurl.com/4e97a), Peter Russell mentioned turning security "down". This is, I think, from the help I went through, a system policy. Help does not tell me...
6
2102
by: paulwilliamsonremove | last post by:
Hi, I have two queries: "qryHistoryPersonIDs" that just contains the "personID" numeric field, and "qryDonations" that just contains the "personID" field, and a date field ("dDonationDate"). I want to delete every record in the qryHistoryPersonIDs recordset that are not found in the qryDonations recordset for a particular date range.
17
3136
by: rdemyan via AccessMonster.com | last post by:
With A2003, I'm having trouble accessing files in a folder on another computer where back-end files, update files, etc are located. Here's the scenario: 1) Computer #1 - A2003 2) Computer #2 - Access 2000; folder with back-ends for both computers and 'Update' folder. I have a launcher program that launces my application (MyApp). The launcher program also checks for updates to MyApp located in 'Update' folder (on
4
1883
by: Frank | last post by:
My program gets a WM_QUERYENDSESSION message and asks the user if it is OK to shutdown. While he's thinking about it, Windows displays a box saying the program is not responding, and if not answered shuts down my program. I need to delay that while until the user answers my program's dialog box. How does Windows check to see if an app is responding.
1
1206
by: Sebouh | last post by:
Hi guys. I''m curious about what happens when windows shuts down. I have a program running that saves data into a file when the form's closing method is invoked. So when Windows shuts down, does it call this method? Plus, i need to implement the method in a way that, when the user clicks the X button on the form, the program minimizes and a notify icon appears. The problem is if i call e.cancel, to cancel the close, Windows doesn't shut...
7
3047
by: Salad | last post by:
I am converting an application from A97 to A2003. I have 2 tables created by another application as a Foxpro.dbf. The table has no index. The connect string in A97 is FoxPro 2.0;HDR=NO;IMEX=2;DATABASE=C:\Test It's really easy to connect to those tables in A97. I'm having difficulties in A2003. I'm trying to follow the instructions in http://support.microsoft.com/kb/824264/.
5
1869
by: drexlin | last post by:
We have an application that is supposed to run as a service. When someone shuts down the computer, the app is supposed to save the contents of the screen into a file so it can be loaded back up when the computer comes back on. So my question is, does shuting down the computer send a WM_DESTROY message to the program if it is being run as a service? If not, why not? Thanks!
3
2593
by: Salad | last post by:
I am using A2003, SP3. If I use the QueryBuilder and select a table and drag the fields to it and then select Query/Append from the menu as the type of query, the first table name (alphabetically) never, ever shows up. I have to create a junk table..I may copy an existing table to a name like AAA...and then the second table in the alphabetical list will show up. Ex: If I have tables A, B, C, and D and I select table B and want to...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8747
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
8528
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
7356
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...
0
5649
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
2752
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
1737
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.