|
-
Aug 7th, 2000, 09:32 PM
#1
Thread Starter
Lively Member
Hi everyone,
I have a password protected Access db, where I have reports.
I use this code, to preview the report.
Dim axs as New Access.Application
axs.OpencurrentDatabase("Path")
axs.Docmd.OpenReport "ReportName"
Set axs = Nothing
A small dialog box pops up, asking for the database password.
How can I provide the password in the code, so that the user need not enter it.
Please help.
Thank you.
-
Aug 8th, 2000, 12:00 AM
#2
Frenzied Member
Originally posted by rathi
Hi everyone,
I have a password protected Access db, where I have reports.
I use this code, to preview the report.
Dim axs as New Access.Application
axs.OpencurrentDatabase("Path")
axs.Docmd.OpenReport "ReportName"
Set axs = Nothing
A small dialog box pops up, asking for the database password.
How can I provide the password in the code, so that the user need not enter it.
Please help.
Thank you.
Not sure if this will work but you can add the following parm to the command line when you run Access; /pwd password. So you might give:
axs.OpencurrentDatabase("Path" & " /pwd password")
a try.
-
Aug 9th, 2000, 11:33 AM
#3
Frenzied Member
-
Aug 9th, 2000, 09:43 PM
#4
Thread Starter
Lively Member
Originally posted by JHausmann
So, did it work?
Hausmann,
Sorry, it didn't work. But I got a wonderful idea from a friend to solve this.
using SendKeys, I have to send the password, before opening the Report.
This works.
Thanks for your support
-
May 12th, 2001, 11:49 AM
#5
Lively Member
Hey Rathi! Could you please, PLEASE post the code that you got for this?? This is EXACTLY what my problem is right now! I'm trying to do the same thing you did! I'd really appreciate it!!
thomas
-
May 13th, 2001, 11:24 AM
#6
Guru
-
May 13th, 2001, 10:06 PM
#7
Lively Member
Sorry Tom! I'm using ADO, not DAO!! That's why I need Rathi's solution! But thanks anyway...er...unless YOU know a way to do this using ADO?? <sg>
-
May 14th, 2001, 10:16 PM
#8
Guru
Well ain't this special?
from Microsoft:
http://support.microsoft.com/support.../q210/1/11.asp
Although in DAO, you can use the OpenDatabase method to open such a database without getting a password prompt, there is no method to do so in Access prior to Access 2002. The Application.OpenCurrentDatabase method of Access2002 includes and optional parameter to specify the database password.
Sorry Thom! Looks like you get to include the big, bulky DAO distribution with your app
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|