Solved

Opening secure database

Posted on 2009-04-02
7
240 Views
Last Modified: 2013-11-10
Hi,

I'm using access 2003.

I'm looking for a way to automate a re-occuring (via task scheduler) macro i've created inside my access database; after I searched the internet i came up with the following code:

dim accessApp
set accessApp = createObject("Access.Application")
accessApp.OpenCurrentDataBase("C:\some path name\someMdb.mdb")
accessApp.Run "TimeUpDate"
accessApp.Quit
set accessApp = nothing

This will open the database and run a macro but, my database is secured I've got a anoying security message when i open the database.

Now I've got two questions;
1) how do I pass my Username and password to the database log in screen ( database is secured via access security)
2) how do I avoid the security warnings I get when opening the database?

Cheers,
Paul
0
Comment
Question by:_Knocks_
  • 4
  • 3
7 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24049023
Change this line
accessApp.OpenCurrentDataBase("C:\some path name\someMdb.mdb")

to this

accessApp.OpenCurrentDataBase("C:\some path name\someMdb.mdb", False, "MyPassword")

This would supply the password to the database and may also stop the security warnings.
0
 

Author Comment

by:_Knocks_
ID: 24049128
I'm trying to open a secure database, not a password protected database, so the database requires a .mdw file in it's startup as well

Any ideas?
0
 

Author Comment

by:_Knocks_
ID: 24049199
I'm looking for exactly the solution as described in this item;

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_23060473.html

But then the complete code...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 24049249
What you mean by complete code?

Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")

Set oExec = WshShell.Exec("C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" /wrkgrp \\cotserver\vol1\departments\fire\databases\cityfire.mdw "\\cotserver\vol1\departments\fire\databases\cityfire personnel.mdb" /user="scott" /pwd="pass")
0
 

Author Comment

by:_Knocks_
ID: 24050363
We are getting there, I'm still tripping over the spaces in my path, how would I make clear that there is a space in the path I tried %20 and i tried _ but both didn't work,

Any ideas?
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 500 total points
ID: 24050636
Where there is a space, use quotes like this
"""C:\Program Files"""
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24057848
Why do you think my answer was B grade?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
A short article about a problem I had getting the GPS LocationListener working.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now