?
Solved

Opening secure database

Posted on 2009-04-02
7
Medium Priority
?
259 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
Industry Leaders: 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 1500 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 1500 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

Industry Leaders: 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!

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Progress

771 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