Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

updating at night 1

Status
Not open for further replies.

Xzibit7

Technical User
Jun 20, 2006
172
US
I currently have a macro that gets data from a huge list using a passthru query then matches that with my part numbers in my database. This process currently takes quite awhile, initially I was going to use dhookom's idea of using vb to accomplish this much faster. Unfortunately this is my first database and I do not feel I have the expertise to do this. SO I was going to have access update my database nightly for me. I have read the faqs and understand that xp has a scheduled tasks feature that I would use. I can't however seem to get this to work. I am required to log-off from the server when I leave work. All I essentialy want is for Access to come on when I am logged off at around midnight and perform one macro then shut down and log me off again. Is this possible?
 
Okay my log on information is not a problem but my access database is password protected as well. Soit starts up but just stays on the password screen. Also I think if I can get past the database security all I have to do is have some sort of timer code for my macro.
 
Is it an option to create another database, not password protected, that ONLY has the macro and necessary objects to run the macro?

C-D2
 

Take a look at Startup command-line options to open the database and provide security info with a shortcut
 
What would the format be to provide security info with a shortcut?
 
The useful options:
\path\to\msaccess.exe \path\to\database.dbs /user username /pwd password /wkgrp \path\to\groupfile.mdw /x macroname

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Okay here is what I set up:

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"
"G:\data\V\VE\VEA\EPD\program files\FrontEnd\EngineeringProjectDatabase.mdb"
/user Admin
/pwd jonblaze /wkgrp "G:\data\V\VE\VEA\EPD\program files\Security\epd2.mdw" /x update



I've got two problems though:
1. is that once I click the shortcut I get an error message that reads the command line that you used to start microsoft access contains a command that access does not regognize

exit and restart ms access using valid command line options

Then when I click okay 4 times it works and starts up my database not even needing my password

2. I get the security warning on start-up about macros now I have tried repeatedly to turn this off by going into tools then macros and then setting security to low. Everytime I do this it saves it and then on the next startup I get the same message.

 
OOps, sorry for the typo.
Replace this:
/wkgrp
with this:
/wrkgrp

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
great thanks...I still can't get rid of that security warning on startup about macros though. I have to press enter for it to go away
 
It's strange even right after I click ok for the security level to go from to low for macros it goes right back to medium
 
okay I found this on the microsoft site
Const cDatabaseToOpen = "C:\<FileToOpen>.mdb"

On Error Resume Next
Dim AcApp
Set AcApp = CreateObject("Access.Application")
If Val(AcApp.Version) >= 11 Then
AcApp.AutomationSecurity = 1 ' msoAutomationSecurityLow
End If
AcApp.Visible = True
AcApp.OpenCurrentDatabase cDatabaseToOpen
If AcApp.CurrentProject.FullName <> "" Then
AcApp.UserControl = True
Else
AcApp.Quit
MsgBox "Failed to open '" & cDatabaseToOpen & "'."
End If

but do I put it into a module or somewhere outside the database
 
Okay I know that I need to make a vbs file with this information but how is that going to affect the shortcut that I just created(can I just put the vbs file in place of my database location) and how do I actually make a .vbs file I tried just saving it in wordpad as .vbs and got tons of errors. Okay lots of questions sorry. thanks for all the help everyone.
 
Xzibit7

Open MS-Access (not an mdb), make that change and exit. The next time you wont have to deal with it!
 
Okay I tried that, I think my administrator does not allow changes to the macro settings in office, and I cant go into office in the control panel and add the file I need to make myself a trusted publisher. So I think the vbs code is all I can do (besides contacting my system administrator which could take months). I was thinking I could make the code the shortcut and then add the access information in that but I have no idea how to do that. Any help would be appreciated.
 
My problem has been solved by my adminnistrator..totally unexpected thanks everyone
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top