Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 11-18-2019, 07:35 AM   #1
Wapug
Newly Registered User
 
Join Date: Apr 2017
Posts: 40
Thanks: 3
Thanked 0 Times in 0 Posts
Wapug is on a distinguished road
Odd New Error

Ive been using the same database for quite some time. The only recent change has been that I have code to backup the db on closing. Here's the issue. I have a series of steps (with buttons set up) to import data, analyze data & Export Data. I click on these buttons from a form. The last two days that I have used the db, the final step has caused me to get an error that says Microsoft Access has stopped working, and it shuts down the database when I click ok. No Idea why this happens, however I have found out that If I got into the db and open the form with the buttons, in design view and then open the code for the button to export, then Close it and reopen the form in form view and run the "Export Data" macro by pushing the button, it works fine. Any idea what's going on here?

Wapug is offline   Reply With Quote
Old 11-18-2019, 07:39 AM   #2
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 7,246
Thanks: 63
Thanked 1,678 Times in 1,633 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Odd New Error

Sounds like maybe it could be a sign of corruption.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 11-18-2019, 07:41 AM   #3
Alc
Newly Registered User
 
Join Date: Mar 2007
Location: Ontario
Posts: 2,321
Thanks: 50
Thanked 28 Times in 27 Posts
Alc will become famous soon enough Alc will become famous soon enough
Re: Odd New Error

I had a similar problem, some time back.
In my case, the db had also increased in size by a fair amount. Running a compact and repair fixed the problem.
It turned out that one user didn't like the small amount of extra time it took for the back up process to run when the db closed (we're talking under a minute). As a result, he used to close the db using task manager to kill the Access process. Over time, this caused bloat.
Try the compact and repair option. Worst case? It does nothing to help you. Best case? Problem solved.

Alc is offline   Reply With Quote
Old 11-18-2019, 07:56 AM   #4
Wapug
Newly Registered User
 
Join Date: Apr 2017
Posts: 40
Thanks: 3
Thanked 0 Times in 0 Posts
Wapug is on a distinguished road
Re: Odd New Error

I tried the Compact Repair thing, no luck.
Wapug is offline   Reply With Quote
Old 11-18-2019, 07:57 AM   #5
Alc
Newly Registered User
 
Join Date: Mar 2007
Location: Ontario
Posts: 2,321
Thanks: 50
Thanked 28 Times in 27 Posts
Alc will become famous soon enough Alc will become famous soon enough
Re: Odd New Error

Quote:
Originally Posted by Wapug View Post
I tried the Compact Repair thing, no luck.
Have you tried importing everything into a new, blank db?
Takes longer than the compact and repair, but it's helped me in the past.
Alc is offline   Reply With Quote
Old 11-18-2019, 08:38 AM   #6
Wapug
Newly Registered User
 
Join Date: Apr 2017
Posts: 40
Thanks: 3
Thanked 0 Times in 0 Posts
Wapug is on a distinguished road
Re: Odd New Error

I deleted my backup code. I was backing up the db at close and something about my code was causing an issue.
Wapug is offline   Reply With Quote
Old 11-18-2019, 08:39 AM   #7
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 7,246
Thanks: 63
Thanked 1,678 Times in 1,633 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Odd New Error

Quote:
Originally Posted by Wapug View Post
I deleted my backup code. I was backing up the db at close and something about my code was causing an issue.
Was it causing corruption?

__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 11-18-2019, 08:42 AM   #8
Alc
Newly Registered User
 
Join Date: Mar 2007
Location: Ontario
Posts: 2,321
Thanks: 50
Thanked 28 Times in 27 Posts
Alc will become famous soon enough Alc will become famous soon enough
Re: Odd New Error

Quote:
Originally Posted by Wapug View Post
I deleted my backup code. I was backing up the db at close and something about my code was causing an issue.
If it's any use, I use this on close in multiple databases, to back up the various back ends. No problems, thus far.

Code:
Function Backup_Backend()
    Dim strPath As String
    Dim strFile As String
    Dim strBackUpFile As String
    Dim strTempFile As String
    Dim strBackUpFolder As String
    Dim fso As Object
    Dim strOldPath As String
    Dim strNewPath As String

    strOldPath = {path including name of db back end}
    strBackUpFolder = {folder for back up copy}
    strNewPath = strBackUpFolder & {name of back end} & Format(Date, "Dddd, dd-mm-yyyy") & ".accdb"

    If FileExists(strNewPath) Then
        Kill (strNewPath)
    End If

    Set fso = CreateObject("Scripting.FileSystemObject")

    fso.CopyFile strOldPath, strNewPath
    Set fso = Nothing
End Function
Alc is offline   Reply With Quote
Old 11-18-2019, 11:27 AM   #9
Wapug
Newly Registered User
 
Join Date: Apr 2017
Posts: 40
Thanks: 3
Thanked 0 Times in 0 Posts
Wapug is on a distinguished road
Re: Odd New Error

Quote:
Originally Posted by theDBguy View Post
Was it causing corruption?
Honestly, I'm not sure what it was doing, but once I removed it the problem stopped. Now I have no idea how to backup the database, other than doing a manual backup. I cant even imagine how a function tied to a button that backs up and closes the database would corrupt it in such an odd way. Man Im flustered today.
Wapug is offline   Reply With Quote
Old 11-18-2019, 11:29 AM   #10
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 7,246
Thanks: 63
Thanked 1,678 Times in 1,633 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Odd New Error

Quote:
Originally Posted by Wapug View Post
Honestly, I'm not sure what it was doing, but once I removed it the problem stopped. Now I have no idea how to backup the database, other than doing a manual backup. I cant even imagine how a function tied to a button that backs up and closes the database would corrupt it in such an odd way. Man Im flustered today.
Not sure what code you were using before, but this is what I use, which is similar to what Alc just posted, and I don't remember getting any corruption issues from it. Hope it helps...
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
The Following User Says Thank You to theDBguy For This Useful Post:
MickJav (11-18-2019)
Old 11-18-2019, 11:52 AM   #11
Wapug
Newly Registered User
 
Join Date: Apr 2017
Posts: 40
Thanks: 3
Thanked 0 Times in 0 Posts
Wapug is on a distinguished road
Re: Odd New Error

I don't have a split database, so IM not sure I can use that. I use this code

Public Function fMakeBackup() As Boolean
Dim Source As String
Dim Target As String
Dim retval As Integer

Source = CurrentDb.Name
Target = "c\backuphere" & " "
Target = Target & Format(Date, "mm-dd") & " Open "
Target = Target & Format(Time, "hhmm") & ".accdb"
Target = Target & ".accdb"
' create the backup
retval = 0
Dim objFSO As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
retval = objFSO.CopyFile(Source, Target, True)
Set objFSO = Nothing
End Function
Wapug is offline   Reply With Quote
Old 11-18-2019, 11:55 AM   #12
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 7,246
Thanks: 63
Thanked 1,678 Times in 1,633 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Odd New Error

Quote:
Originally Posted by Wapug View Post
I don't have a split database...
Ahh, that would be your first issue. You should really consider splitting your database, if it's being used by multiple users at the same time. Improperly sharing a database can lead to file and data corruptions.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 11-18-2019, 11:56 AM   #13
Alc
Newly Registered User
 
Join Date: Mar 2007
Location: Ontario
Posts: 2,321
Thanks: 50
Thanked 28 Times in 27 Posts
Alc will become famous soon enough Alc will become famous soon enough
Re: Odd New Error

Quote:
Originally Posted by theDBguy View Post
Ahh, that would be your first issue. You should really consider splitting your database, if it's being used by multiple users at the same time. Improperly sharing a database can lead to file and data corruptions.
Was halfway through typing the same thing.
Alc is offline   Reply With Quote
Old 11-18-2019, 12:02 PM   #14
Wapug
Newly Registered User
 
Join Date: Apr 2017
Posts: 40
Thanks: 3
Thanked 0 Times in 0 Posts
Wapug is on a distinguished road
Re: Odd New Error

The database is only used by one person, it doesn't make sense to have it split. Is it possible to back it up with a command button, or tying a function to a button like I already have? By one person I mean, there are never multiple people accessing it, its always one person using it each day (usually me).
Wapug is offline   Reply With Quote
Old 11-18-2019, 12:44 PM   #15
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 7,246
Thanks: 63
Thanked 1,678 Times in 1,633 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Odd New Error

Quote:
Originally Posted by Wapug View Post
The database is only used by one person, it doesn't make sense to have it split. Is it possible to back it up with a command button, or tying a function to a button like I already have? By one person I mean, there are never multiple people accessing it, its always one person using it each day (usually me).
Hi. It's still recommended "best practice" to split a database even if there's only one user using it at a time. You mentioned multiple users are accessing it, although only one at a time. Does this mean the database file is stored in a shared network location? If so, do you happen to do a Compact & Repair on it? If so, exactly how do you do it? Performing a C&R over the network is also another potential source of corruption.

__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Run time error '3075': Syntax error (missing operator) in query expression manusri Modules & VBA 9 02-16-2017 05:45 PM
Question strSQL = Run Time Error 3075 Syntax Error Missing Operator in qry Expr maxsun08 General 4 07-27-2012 06:39 AM
Error "Run-time error '1004': General ODBC Error D4WNO General 1 07-19-2012 07:42 AM
Error 3734 (share mode error) appearing in error guy- Modules & VBA 2 09-28-2011 02:02 AM
A question about the error message "Run-time error '3061' Too few parameters, Expecte dariyoosh Modules & VBA 7 03-12-2010 06:26 AM




All times are GMT -8. The time now is 01:53 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World