Solved

Opening secure database

Posted on 2009-04-02
7
251 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_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

729 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