Solved

Opening secure database

Posted on 2009-04-02
7
238 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
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.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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…

760 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

18 Experts available now in Live!

Get 1:1 Help Now