Solved

Opening secure database

Posted on 2009-04-02
7
250 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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 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 …

732 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