There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen boot computer connection crash css dell display driver drivers email error ethernet excel explorer firefox firefox 3 freeze game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook express partition password printer problem router slow software sound startup trojan usb virus vista windows windows xp wireless
Business Applications
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: Access 2003 & Batch File


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,560 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
16-Jul-2008, 02:14 PM #61
Can you outline for which is the Current problem, as you seem to have had a few.
Is the Switchboard or the backup?
computerman29642's Avatar
Computer Specs
Senior Member with 1,427 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
16-Jul-2008, 02:18 PM #62
When the backup is created, everything appears to work properly. However, if you click on the first button on the switchboard, it will open just fine. Then if you click on the second button (Preview Report), it will work fine as well. Now, go back and click on the first button again, and you will get an error message.
__________________
Computerman29642

"I can do all things through Christ which strengtheneth me."
(Philippians 4:13)
___________________________________________________

“Give, and it shall be given to you. For whatever measure
you deal out to others, it will be dealt to you in return.”
(Luke 6:38)
___________________________________________________

"Imagination is more important than knowledge. Knowledge
is limited. Imagination encircles the world." (Albert Einstein)
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 6,560 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
17-Jul-2008, 06:38 AM #63
The Access "Switchboard" is not a standard Form, which is what I use for my Main Menu (switchboard) in my databases. I think an element of the Switchboard is stored outside of the database and it may be losing it's link to it.
If you change your Switchboard to a normal Form with Command Buttons it should overcome the problem.
How are creating your "Backup"?
__________________
.
.
OBP
I do not give up easily
Rollin_Again's Avatar
Distinguished Member with 2,872 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Brilliant When Sober
17-Jul-2008, 07:19 AM #64
Tony,

Thanks for joining and trying to provide some assistance. The backup is being created automatically when the DB is first opened. This is accomplished by using the AutoExec macro to fire some VBA code. The VBA code is nothing more than using FSO (File Scripting Object) to copy the DB to another location after appending the date to the backup DB name. Do you know of any other ways to automatically backup the DB when it is first opened or when it is closed?

Regards,
Rollin
__________________
Protect your computer and keep it free of pests and other spyware. Download AdAware, Spybot, ZoneAlarm and lots of other great utilities at PC World / SnapFiles / Major Geeks, Tech Guy Stuff

Help Keep this site free by making a small donation

http://www.techguy.org/donate.html

tsghelp / support
computerman29642's Avatar
Computer Specs
Senior Member with 1,427 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
17-Jul-2008, 08:09 AM #65
Tony, if you think the best thing to do is create a "Main Form" instead of using the switchboard, I will certainly be happy to do that.
computerman29642's Avatar
Computer Specs
Senior Member with 1,427 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
17-Jul-2008, 10:14 AM #66
Tony, I created my own switchboard form (frmSwitchboard). I tried running the database to create the backup, but now I get permission type errors.

Please review the attached database.
Attached Files
File Type: zip Movie_Current.zip (128.9 KB, 2 views)
computerman29642's Avatar
Computer Specs
Senior Member with 1,427 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
17-Jul-2008, 02:03 PM #67
Do you think the permissions issue is because it is being created on a network?
computerman29642's Avatar
Computer Specs
Senior Member with 1,427 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
25-Jul-2008, 08:32 AM #68
I tried to create the backup locally instead of on the network, but I am still getting permission errors.

Do you think it maybe due to how I have the startup setup?
Rollin_Again's Avatar
Distinguished Member with 2,872 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Brilliant When Sober
25-Jul-2008, 11:24 AM #69
I'm not sure since I'm not super proficient with Access. The only other thing I can think is that since the DB is open when it is being copied it may be corrupting the DB somehow. The only other solution I can think of is to use a VBS script or to compile a VB executable file that will first copy the DB in question to another location and then open the original for the user to work on. Instead of clicking the Access icon or DB shortcut the user would actually click on the EXE or VBS file instead which would programatically open the DB after first making the backup. Would that work for you? If so, will all users have the network drive mapped the same or will they be able to access using a set file path such as \\ServerName\Directory\Resource

Regards,
Rollin
__________________
Protect your computer and keep it free of pests and other spyware. Download AdAware, Spybot, ZoneAlarm and lots of other great utilities at PC World / SnapFiles / Major Geeks, Tech Guy Stuff

Help Keep this site free by making a small donation

http://www.techguy.org/donate.html

tsghelp / support
computerman29642's Avatar
Computer Specs
Senior Member with 1,427 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
25-Jul-2008, 11:29 AM #70
Rollin, Once the database has been completed, it will not be on a network. It will only be on a local hard drive.

Is there a way to have the code delete the old backup when a new backup is created?

Last edited by computerman29642 : 25-Jul-2008 01:27 PM.
Rollin_Again's Avatar
Distinguished Member with 2,872 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Brilliant When Sober
25-Jul-2008, 01:48 PM #71
Quote:
Originally Posted by gamecockfan View Post
Rollin, Once the database has been completed, it will not be on a network. It will only be on a local hard drive.

Is there a way to have the code delete the old backup when a new backup is created?
Absolutely. Do you only want to maintain 1 backup copy or multiple copies? I like to keep several backups as a safety precaution. The code I use at work keeps the last 5 copies of my Excel workbook in a backup directory. The same theory could be applied to Access.

Regards,
Rollin
__________________
Protect your computer and keep it free of pests and other spyware. Download AdAware, Spybot, ZoneAlarm and lots of other great utilities at PC World / SnapFiles / Major Geeks, Tech Guy Stuff

Help Keep this site free by making a small donation

http://www.techguy.org/donate.html

tsghelp / support
computerman29642's Avatar
Computer Specs
Senior Member with 1,427 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
25-Jul-2008, 01:51 PM #72
Quote:
Absolutely. Do you only want to maintain 1 backup copy or multiple copies? I like to keep several backups as a safety precaution.
In your opinion, how many backup copies should I keep? I was thinking like two copies.
Rollin_Again's Avatar
Distinguished Member with 2,872 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Brilliant When Sober
25-Jul-2008, 03:20 PM #73
Copy and Paste the code below into a text file and then manually change the file extension to .vbs

Change the path to reflect your DB file that you would like to open (vSource)
Change the Destination path to reflect where backup should be saved (vDestination)

Then change the line so that the original DB path is shown
wshShell.Run "MSACCESS.EXE C:\Test\Test.mdb"


Code:
Dim vSource
Dim vDestination
Dim objFSO
Dim wshShell
vSource = "C:\Test\Test.mdb"
vDestination = "C:\Test\Backup\" & Replace(Date, "/", "_") & ".mdb"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set wshShell = WScript.CreateObject ("WSCript.shell")
objFSO.CopyFile vSource, vDestination

wshShell.Run "MSACCESS.EXE C:\Test\Test.mdb"
set objFSO = nothing
Set wshShell = nothing
Run the VBS file and the backup should be made and the original DB opened automatically. From now on when you need to open the DB just open from the VBS instead of clicking the saved MDB file.

It only saves one copy and it is updated each time the DB is opened. If you want to change this later we can look into it.

Regards,
Rollin
__________________
Protect your computer and keep it free of pests and other spyware. Download AdAware, Spybot, ZoneAlarm and lots of other great utilities at PC World / SnapFiles / Major Geeks, Tech Guy Stuff

Help Keep this site free by making a small donation

http://www.techguy.org/donate.html

tsghelp / support
computerman29642's Avatar
Computer Specs
Senior Member with 1,427 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
25-Jul-2008, 03:25 PM #74
Thanks Rollin'.
computerman29642's Avatar
Computer Specs
Senior Member with 1,427 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
25-Jul-2008, 03:40 PM #75
Roliin, the code appears to be working. Thank you very much.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:19 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.