PC Review


Reply
Thread Tools Rate Thread

Database Password - Command Line Switch

 
 
Steven
Guest
Posts: n/a
 
      19th Dec 2009
I have a database with a database level password. I want to open the
database using 'Scheduled Tasks' and pass the password. I have used the /pwd
link and a /User of "Admin" but it is not working. What is the user if I'm
using a database password? is there a way to do this?

I've searched through hundreds of password questions and can't seem to find
it. Any help would be greatly appreciated.

Thank you,
 
Reply With Quote
 
 
 
 
Tom van Stiphout
Guest
Posts: n/a
 
      19th Dec 2009
On Fri, 18 Dec 2009 19:55:01 -0800, Steven
<(E-Mail Removed)> wrote:

You are confusing Workgroup security (which requires a username and
password, and uses the /user, /pwd command line switches) with the
Database Password (which requires only a password, and for which there
is no command line switch).

If you REALLY want to do this, you may want to launch an unsecured
Access app which uses the OpenDatabase method to open your
password-secured app. The connect string can then contain the
password. See http://www.connectionstrings.com/access for details.

-Tom.
Microsoft Access MVP



>I have a database with a database level password. I want to open the
>database using 'Scheduled Tasks' and pass the password. I have used the /pwd
>link and a /User of "Admin" but it is not working. What is the user if I'm
>using a database password? is there a way to do this?
>
>I've searched through hundreds of password questions and can't seem to find
>it. Any help would be greatly appreciated.
>
>Thank you,

 
Reply With Quote
 
Steven
Guest
Posts: n/a
 
      19th Dec 2009
I am confused, obviously.

I also don't know how to use the information you provided.

With database password
This is the connection string to use when you have an access database
protected with a password using the Set Database Password function in
Access.Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet
OLEDBatabase Password=MyDbPassword;

Just copying the access.provider=...into code gives me an error and I don't
know how to call the function.

Any help would be greatly appreciated.

Thank you,

Steven

"Tom van Stiphout" wrote:

> On Fri, 18 Dec 2009 19:55:01 -0800, Steven
> <(E-Mail Removed)> wrote:
>
> You are confusing Workgroup security (which requires a username and
> password, and uses the /user, /pwd command line switches) with the
> Database Password (which requires only a password, and for which there
> is no command line switch).
>
> If you REALLY want to do this, you may want to launch an unsecured
> Access app which uses the OpenDatabase method to open your
> password-secured app. The connect string can then contain the
> password. See http://www.connectionstrings.com/access for details.
>
> -Tom.
> Microsoft Access MVP
>
>
>
> >I have a database with a database level password. I want to open the
> >database using 'Scheduled Tasks' and pass the password. I have used the /pwd
> >link and a /User of "Admin" but it is not working. What is the user if I'm
> >using a database password? is there a way to do this?
> >
> >I've searched through hundreds of password questions and can't seem to find
> >it. Any help would be greatly appreciated.
> >
> >Thank you,

> .
>

 
Reply With Quote
 
Tom van Stiphout
Guest
Posts: n/a
 
      19th Dec 2009
On Sat, 19 Dec 2009 10:13:01 -0800, Steven
<(E-Mail Removed)> wrote:

I played around with OpenDatabase a bit more, and although you can
open a DatabasePassword-protected database with it, that database does
not run its AutoExec macro, which I'm sure is important to you.

So we move on to OpenCurrentDatabase:
Create an unsecured database with an AutoExec macro with one line:
Action=RunCode, FunctionName=InitApplication()

Create a standard module and paste in this code:
'This function is called by AutoExec macro.
Public Function InitApplication()
Const DB_TO_OPEN As String =
"c:\temp\myTestDatabaseWithDbPassword.accdb"
Const DB_PASSWORD As String = "myPassword"
Dim objAccess As Access.Application
Set objAccess = New Access.Application
objAccess.OpenCurrentDatabase DB_TO_OPEN, False, MY_PASSWORD
End Function

Replace myConstants with yours. Close and reopen this db. Observe that
it opens the secured db and runs its autoexec macro.

-Tom.
Microsoft Access MVP



>I am confused, obviously.
>
>I also don't know how to use the information you provided.
>
>With database password
>This is the connection string to use when you have an access database
>protected with a password using the Set Database Password function in
>Access.Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet
>OLEDBatabase Password=MyDbPassword;
>
>Just copying the access.provider=...into code gives me an error and I don't
>know how to call the function.
>
>Any help would be greatly appreciated.
>
>Thank you,
>
>Steven
>
>"Tom van Stiphout" wrote:
>
>> On Fri, 18 Dec 2009 19:55:01 -0800, Steven
>> <(E-Mail Removed)> wrote:
>>
>> You are confusing Workgroup security (which requires a username and
>> password, and uses the /user, /pwd command line switches) with the
>> Database Password (which requires only a password, and for which there
>> is no command line switch).
>>
>> If you REALLY want to do this, you may want to launch an unsecured
>> Access app which uses the OpenDatabase method to open your
>> password-secured app. The connect string can then contain the
>> password. See http://www.connectionstrings.com/access for details.
>>
>> -Tom.
>> Microsoft Access MVP
>>
>>
>>
>> >I have a database with a database level password. I want to open the
>> >database using 'Scheduled Tasks' and pass the password. I have used the /pwd
>> >link and a /User of "Admin" but it is not working. What is the user if I'm
>> >using a database password? is there a way to do this?
>> >
>> >I've searched through hundreds of password questions and can't seem to find
>> >it. Any help would be greatly appreciated.
>> >
>> >Thank you,

>> .
>>

 
Reply With Quote
 
Steven
Guest
Posts: n/a
 
      19th Dec 2009
Tom,

Thank you for the quick replies. So, I didn't do exactly what you said but
it is not getting past the pop-up for the password.

I'm running a non secured database code that would open the other DB that
has a database password. In that db password protected database is an
autoexec macro that runs a module. In that module it looks for a /cmd "auto"
piece that would auto print a report and close the database.

Here is what I have in the unsecured db:

Public Function ITProjectReportTest()
ITProjectReport
End Function

Public Function ITProjectReport()
Const DB_TO_OPEN As String = "l:\access\databases\IT Dept Inventory.mdb"
Const DB_PASSWORD As String = "Password" ' replaced for this purpose
Dim objAccess As Access.Application
Set objAccess = New Access.Application
objAccess.OpenCurrentDatabase DB_TO_OPEN, False, MY_PASSWORD
End Function

I run the test module and it pops up the Enter Password box.

Thank you again for all your help....I see light at the end of the tunnel.
I would love to explore this option but if this is getting too much - I can
link the tables and copy the report over to the unsecured db

"Tom van Stiphout" wrote:

> On Sat, 19 Dec 2009 10:13:01 -0800, Steven
> <(E-Mail Removed)> wrote:
>
> I played around with OpenDatabase a bit more, and although you can
> open a DatabasePassword-protected database with it, that database does
> not run its AutoExec macro, which I'm sure is important to you.
>
> So we move on to OpenCurrentDatabase:
> Create an unsecured database with an AutoExec macro with one line:
> Action=RunCode, FunctionName=InitApplication()
>
> Create a standard module and paste in this code:
> 'This function is called by AutoExec macro.
> Public Function InitApplication()
> Const DB_TO_OPEN As String =
> "c:\temp\myTestDatabaseWithDbPassword.accdb"
> Const DB_PASSWORD As String = "myPassword"
> Dim objAccess As Access.Application
> Set objAccess = New Access.Application
> objAccess.OpenCurrentDatabase DB_TO_OPEN, False, MY_PASSWORD
> End Function
>
> Replace myConstants with yours. Close and reopen this db. Observe that
> it opens the secured db and runs its autoexec macro.
>
> -Tom.
> Microsoft Access MVP
>
>
>
> >I am confused, obviously.
> >
> >I also don't know how to use the information you provided.
> >
> >With database password
> >This is the connection string to use when you have an access database
> >protected with a password using the Set Database Password function in
> >Access.Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet
> >OLEDBatabase Password=MyDbPassword;
> >
> >Just copying the access.provider=...into code gives me an error and I don't
> >know how to call the function.
> >
> >Any help would be greatly appreciated.
> >
> >Thank you,
> >
> >Steven
> >
> >"Tom van Stiphout" wrote:
> >
> >> On Fri, 18 Dec 2009 19:55:01 -0800, Steven
> >> <(E-Mail Removed)> wrote:
> >>
> >> You are confusing Workgroup security (which requires a username and
> >> password, and uses the /user, /pwd command line switches) with the
> >> Database Password (which requires only a password, and for which there
> >> is no command line switch).
> >>
> >> If you REALLY want to do this, you may want to launch an unsecured
> >> Access app which uses the OpenDatabase method to open your
> >> password-secured app. The connect string can then contain the
> >> password. See http://www.connectionstrings.com/access for details.
> >>
> >> -Tom.
> >> Microsoft Access MVP
> >>
> >>
> >>
> >> >I have a database with a database level password. I want to open the
> >> >database using 'Scheduled Tasks' and pass the password. I have used the /pwd
> >> >link and a /User of "Admin" but it is not working. What is the user if I'm
> >> >using a database password? is there a way to do this?
> >> >
> >> >I've searched through hundreds of password questions and can't seem to find
> >> >it. Any help would be greatly appreciated.
> >> >
> >> >Thank you,
> >> .
> >>

> .
>

 
Reply With Quote
 
Tom van Stiphout
Guest
Posts: n/a
 
      20th Dec 2009
On Sat, 19 Dec 2009 12:59:01 -0800, Steven
<(E-Mail Removed)> wrote:

You probably do not have OPTION EXPLICIT at the top of your code
module. This option is CRITICAL for programmers and it's too bad MSFT
doesn't see it that way. Please also turn on this option in Tools >
Options.
Once in place, select Debug > Compile, and it will become obvious why
your version does not work (hint: DB_PASSWORD <> MY_PASSWORD).

-Tom.
Microsoft Access MVP


>Tom,
>
>Thank you for the quick replies. So, I didn't do exactly what you said but
>it is not getting past the pop-up for the password.
>
>I'm running a non secured database code that would open the other DB that
>has a database password. In that db password protected database is an
>autoexec macro that runs a module. In that module it looks for a /cmd "auto"
>piece that would auto print a report and close the database.
>
>Here is what I have in the unsecured db:
>
>Public Function ITProjectReportTest()
> ITProjectReport
>End Function
>
>Public Function ITProjectReport()
> Const DB_TO_OPEN As String = "l:\access\databases\IT Dept Inventory.mdb"
> Const DB_PASSWORD As String = "Password" ' replaced for this purpose
> Dim objAccess As Access.Application
> Set objAccess = New Access.Application
> objAccess.OpenCurrentDatabase DB_TO_OPEN, False, MY_PASSWORD
>End Function
>
>I run the test module and it pops up the Enter Password box.
>
>Thank you again for all your help....I see light at the end of the tunnel.
>I would love to explore this option but if this is getting too much - I can
>link the tables and copy the report over to the unsecured db
>
>"Tom van Stiphout" wrote:
>
>> On Sat, 19 Dec 2009 10:13:01 -0800, Steven
>> <(E-Mail Removed)> wrote:
>>
>> I played around with OpenDatabase a bit more, and although you can
>> open a DatabasePassword-protected database with it, that database does
>> not run its AutoExec macro, which I'm sure is important to you.
>>
>> So we move on to OpenCurrentDatabase:
>> Create an unsecured database with an AutoExec macro with one line:
>> Action=RunCode, FunctionName=InitApplication()
>>
>> Create a standard module and paste in this code:
>> 'This function is called by AutoExec macro.
>> Public Function InitApplication()
>> Const DB_TO_OPEN As String =
>> "c:\temp\myTestDatabaseWithDbPassword.accdb"
>> Const DB_PASSWORD As String = "myPassword"
>> Dim objAccess As Access.Application
>> Set objAccess = New Access.Application
>> objAccess.OpenCurrentDatabase DB_TO_OPEN, False, MY_PASSWORD
>> End Function
>>
>> Replace myConstants with yours. Close and reopen this db. Observe that
>> it opens the secured db and runs its autoexec macro.
>>
>> -Tom.
>> Microsoft Access MVP
>>
>>
>>
>> >I am confused, obviously.
>> >
>> >I also don't know how to use the information you provided.
>> >
>> >With database password
>> >This is the connection string to use when you have an access database
>> >protected with a password using the Set Database Password function in
>> >Access.Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet
>> >OLEDBatabase Password=MyDbPassword;
>> >
>> >Just copying the access.provider=...into code gives me an error and I don't
>> >know how to call the function.
>> >
>> >Any help would be greatly appreciated.
>> >
>> >Thank you,
>> >
>> >Steven
>> >
>> >"Tom van Stiphout" wrote:
>> >
>> >> On Fri, 18 Dec 2009 19:55:01 -0800, Steven
>> >> <(E-Mail Removed)> wrote:
>> >>
>> >> You are confusing Workgroup security (which requires a username and
>> >> password, and uses the /user, /pwd command line switches) with the
>> >> Database Password (which requires only a password, and for which there
>> >> is no command line switch).
>> >>
>> >> If you REALLY want to do this, you may want to launch an unsecured
>> >> Access app which uses the OpenDatabase method to open your
>> >> password-secured app. The connect string can then contain the
>> >> password. See http://www.connectionstrings.com/access for details.
>> >>
>> >> -Tom.
>> >> Microsoft Access MVP
>> >>
>> >>
>> >>
>> >> >I have a database with a database level password. I want to open the
>> >> >database using 'Scheduled Tasks' and pass the password. I have used the /pwd
>> >> >link and a /User of "Admin" but it is not working. What is the user if I'm
>> >> >using a database password? is there a way to do this?
>> >> >
>> >> >I've searched through hundreds of password questions and can't seem to find
>> >> >it. Any help would be greatly appreciated.
>> >> >
>> >> >Thank you,
>> >> .
>> >>

>> .
>>

 
Reply With Quote
 
Steven
Guest
Posts: n/a
 
      21st Dec 2009
Tom,

Thank you again for your help.

I did not have option explicit on nor was 'Require Variable Declaration'
checked in the Tools - Options section; they are now AND it worked. Thank
you.

Perhaps you know the answer to my next part. Can you also pass a /cmd
variable through this process?

Steven

"Tom van Stiphout" wrote:

> On Sat, 19 Dec 2009 12:59:01 -0800, Steven
> <(E-Mail Removed)> wrote:
>
> You probably do not have OPTION EXPLICIT at the top of your code
> module. This option is CRITICAL for programmers and it's too bad MSFT
> doesn't see it that way. Please also turn on this option in Tools >
> Options.
> Once in place, select Debug > Compile, and it will become obvious why
> your version does not work (hint: DB_PASSWORD <> MY_PASSWORD).
>
> -Tom.
> Microsoft Access MVP
>
>
> >Tom,
> >
> >Thank you for the quick replies. So, I didn't do exactly what you said but
> >it is not getting past the pop-up for the password.
> >
> >I'm running a non secured database code that would open the other DB that
> >has a database password. In that db password protected database is an
> >autoexec macro that runs a module. In that module it looks for a /cmd "auto"
> >piece that would auto print a report and close the database.
> >
> >Here is what I have in the unsecured db:
> >
> >Public Function ITProjectReportTest()
> > ITProjectReport
> >End Function
> >
> >Public Function ITProjectReport()
> > Const DB_TO_OPEN As String = "l:\access\databases\IT Dept Inventory.mdb"
> > Const DB_PASSWORD As String = "Password" ' replaced for this purpose
> > Dim objAccess As Access.Application
> > Set objAccess = New Access.Application
> > objAccess.OpenCurrentDatabase DB_TO_OPEN, False, MY_PASSWORD
> >End Function
> >
> >I run the test module and it pops up the Enter Password box.
> >
> >Thank you again for all your help....I see light at the end of the tunnel.
> >I would love to explore this option but if this is getting too much - I can
> >link the tables and copy the report over to the unsecured db
> >
> >"Tom van Stiphout" wrote:
> >
> >> On Sat, 19 Dec 2009 10:13:01 -0800, Steven
> >> <(E-Mail Removed)> wrote:
> >>
> >> I played around with OpenDatabase a bit more, and although you can
> >> open a DatabasePassword-protected database with it, that database does
> >> not run its AutoExec macro, which I'm sure is important to you.
> >>
> >> So we move on to OpenCurrentDatabase:
> >> Create an unsecured database with an AutoExec macro with one line:
> >> Action=RunCode, FunctionName=InitApplication()
> >>
> >> Create a standard module and paste in this code:
> >> 'This function is called by AutoExec macro.
> >> Public Function InitApplication()
> >> Const DB_TO_OPEN As String =
> >> "c:\temp\myTestDatabaseWithDbPassword.accdb"
> >> Const DB_PASSWORD As String = "myPassword"
> >> Dim objAccess As Access.Application
> >> Set objAccess = New Access.Application
> >> objAccess.OpenCurrentDatabase DB_TO_OPEN, False, MY_PASSWORD
> >> End Function
> >>
> >> Replace myConstants with yours. Close and reopen this db. Observe that
> >> it opens the secured db and runs its autoexec macro.
> >>
> >> -Tom.
> >> Microsoft Access MVP
> >>
> >>
> >>
> >> >I am confused, obviously.
> >> >
> >> >I also don't know how to use the information you provided.
> >> >
> >> >With database password
> >> >This is the connection string to use when you have an access database
> >> >protected with a password using the Set Database Password function in
> >> >Access.Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet
> >> >OLEDBatabase Password=MyDbPassword;
> >> >
> >> >Just copying the access.provider=...into code gives me an error and I don't
> >> >know how to call the function.
> >> >
> >> >Any help would be greatly appreciated.
> >> >
> >> >Thank you,
> >> >
> >> >Steven
> >> >
> >> >"Tom van Stiphout" wrote:
> >> >
> >> >> On Fri, 18 Dec 2009 19:55:01 -0800, Steven
> >> >> <(E-Mail Removed)> wrote:
> >> >>
> >> >> You are confusing Workgroup security (which requires a username and
> >> >> password, and uses the /user, /pwd command line switches) with the
> >> >> Database Password (which requires only a password, and for which there
> >> >> is no command line switch).
> >> >>
> >> >> If you REALLY want to do this, you may want to launch an unsecured
> >> >> Access app which uses the OpenDatabase method to open your
> >> >> password-secured app. The connect string can then contain the
> >> >> password. See http://www.connectionstrings.com/access for details.
> >> >>
> >> >> -Tom.
> >> >> Microsoft Access MVP
> >> >>
> >> >>
> >> >>
> >> >> >I have a database with a database level password. I want to open the
> >> >> >database using 'Scheduled Tasks' and pass the password. I have used the /pwd
> >> >> >link and a /User of "Admin" but it is not working. What is the user if I'm
> >> >> >using a database password? is there a way to do this?
> >> >> >
> >> >> >I've searched through hundreds of password questions and can't seem to find
> >> >> >it. Any help would be greatly appreciated.
> >> >> >
> >> >> >Thank you,
> >> >> .
> >> >>
> >> .
> >>

> .
>

 
Reply With Quote
 
Tom van Stiphout
Guest
Posts: n/a
 
      22nd Dec 2009
On Mon, 21 Dec 2009 08:05:01 -0800, Steven
<(E-Mail Removed)> wrote:

I don't think so, but here is an elegant solution: after the
OpenCurrentDatabase call, write:
objAccess.DoCmd.RunMacro "myMacro"

-Tom.
Microsoft Access MVP


>Tom,
>
>Thank you again for your help.
>
>I did not have option explicit on nor was 'Require Variable Declaration'
>checked in the Tools - Options section; they are now AND it worked. Thank
>you.
>
>Perhaps you know the answer to my next part. Can you also pass a /cmd
>variable through this process?
>
>Steven
>
>"Tom van Stiphout" wrote:
>
>> On Sat, 19 Dec 2009 12:59:01 -0800, Steven
>> <(E-Mail Removed)> wrote:
>>
>> You probably do not have OPTION EXPLICIT at the top of your code
>> module. This option is CRITICAL for programmers and it's too bad MSFT
>> doesn't see it that way. Please also turn on this option in Tools >
>> Options.
>> Once in place, select Debug > Compile, and it will become obvious why
>> your version does not work (hint: DB_PASSWORD <> MY_PASSWORD).
>>
>> -Tom.
>> Microsoft Access MVP
>>
>>
>> >Tom,
>> >
>> >Thank you for the quick replies. So, I didn't do exactly what you said but
>> >it is not getting past the pop-up for the password.
>> >
>> >I'm running a non secured database code that would open the other DB that
>> >has a database password. In that db password protected database is an
>> >autoexec macro that runs a module. In that module it looks for a /cmd "auto"
>> >piece that would auto print a report and close the database.
>> >
>> >Here is what I have in the unsecured db:
>> >
>> >Public Function ITProjectReportTest()
>> > ITProjectReport
>> >End Function
>> >
>> >Public Function ITProjectReport()
>> > Const DB_TO_OPEN As String = "l:\access\databases\IT Dept Inventory.mdb"
>> > Const DB_PASSWORD As String = "Password" ' replaced for this purpose
>> > Dim objAccess As Access.Application
>> > Set objAccess = New Access.Application
>> > objAccess.OpenCurrentDatabase DB_TO_OPEN, False, MY_PASSWORD
>> >End Function
>> >
>> >I run the test module and it pops up the Enter Password box.
>> >
>> >Thank you again for all your help....I see light at the end of the tunnel.
>> >I would love to explore this option but if this is getting too much - I can
>> >link the tables and copy the report over to the unsecured db
>> >
>> >"Tom van Stiphout" wrote:
>> >
>> >> On Sat, 19 Dec 2009 10:13:01 -0800, Steven
>> >> <(E-Mail Removed)> wrote:
>> >>
>> >> I played around with OpenDatabase a bit more, and although you can
>> >> open a DatabasePassword-protected database with it, that database does
>> >> not run its AutoExec macro, which I'm sure is important to you.
>> >>
>> >> So we move on to OpenCurrentDatabase:
>> >> Create an unsecured database with an AutoExec macro with one line:
>> >> Action=RunCode, FunctionName=InitApplication()
>> >>
>> >> Create a standard module and paste in this code:
>> >> 'This function is called by AutoExec macro.
>> >> Public Function InitApplication()
>> >> Const DB_TO_OPEN As String =
>> >> "c:\temp\myTestDatabaseWithDbPassword.accdb"
>> >> Const DB_PASSWORD As String = "myPassword"
>> >> Dim objAccess As Access.Application
>> >> Set objAccess = New Access.Application
>> >> objAccess.OpenCurrentDatabase DB_TO_OPEN, False, MY_PASSWORD
>> >> End Function
>> >>
>> >> Replace myConstants with yours. Close and reopen this db. Observe that
>> >> it opens the secured db and runs its autoexec macro.
>> >>
>> >> -Tom.
>> >> Microsoft Access MVP
>> >>
>> >>
>> >>
>> >> >I am confused, obviously.
>> >> >
>> >> >I also don't know how to use the information you provided.
>> >> >
>> >> >With database password
>> >> >This is the connection string to use when you have an access database
>> >> >protected with a password using the Set Database Password function in
>> >> >Access.Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet
>> >> >OLEDBatabase Password=MyDbPassword;
>> >> >
>> >> >Just copying the access.provider=...into code gives me an error and I don't
>> >> >know how to call the function.
>> >> >
>> >> >Any help would be greatly appreciated.
>> >> >
>> >> >Thank you,
>> >> >
>> >> >Steven
>> >> >
>> >> >"Tom van Stiphout" wrote:
>> >> >
>> >> >> On Fri, 18 Dec 2009 19:55:01 -0800, Steven
>> >> >> <(E-Mail Removed)> wrote:
>> >> >>
>> >> >> You are confusing Workgroup security (which requires a username and
>> >> >> password, and uses the /user, /pwd command line switches) with the
>> >> >> Database Password (which requires only a password, and for which there
>> >> >> is no command line switch).
>> >> >>
>> >> >> If you REALLY want to do this, you may want to launch an unsecured
>> >> >> Access app which uses the OpenDatabase method to open your
>> >> >> password-secured app. The connect string can then contain the
>> >> >> password. See http://www.connectionstrings.com/access for details.
>> >> >>
>> >> >> -Tom.
>> >> >> Microsoft Access MVP
>> >> >>
>> >> >>
>> >> >>
>> >> >> >I have a database with a database level password. I want to open the
>> >> >> >database using 'Scheduled Tasks' and pass the password. I have used the /pwd
>> >> >> >link and a /User of "Admin" but it is not working. What is the user if I'm
>> >> >> >using a database password? is there a way to do this?
>> >> >> >
>> >> >> >I've searched through hundreds of password questions and can't seem to find
>> >> >> >it. Any help would be greatly appreciated.
>> >> >> >
>> >> >> >Thank you,
>> >> >> .
>> >> >>
>> >> .
>> >>

>> .
>>

 
Reply With Quote
 
Steven
Guest
Posts: n/a
 
      22nd Dec 2009
Tom,

Thank you for your help. I ended up placing the code below to have it auto
function based on the time I scheduled the auto printout:
If Time < CDate("06:00") Then
result = AutoProcess()
Exit Function
End If

You were very helful.

Have a great holiday,
Steven

"Tom van Stiphout" wrote:

> On Mon, 21 Dec 2009 08:05:01 -0800, Steven
> <(E-Mail Removed)> wrote:
>
> I don't think so, but here is an elegant solution: after the
> OpenCurrentDatabase call, write:
> objAccess.DoCmd.RunMacro "myMacro"
>
> -Tom.
> Microsoft Access MVP
>
>
> >Tom,
> >
> >Thank you again for your help.
> >
> >I did not have option explicit on nor was 'Require Variable Declaration'
> >checked in the Tools - Options section; they are now AND it worked. Thank
> >you.
> >
> >Perhaps you know the answer to my next part. Can you also pass a /cmd
> >variable through this process?
> >
> >Steven
> >
> >"Tom van Stiphout" wrote:
> >
> >> On Sat, 19 Dec 2009 12:59:01 -0800, Steven
> >> <(E-Mail Removed)> wrote:
> >>
> >> You probably do not have OPTION EXPLICIT at the top of your code
> >> module. This option is CRITICAL for programmers and it's too bad MSFT
> >> doesn't see it that way. Please also turn on this option in Tools >
> >> Options.
> >> Once in place, select Debug > Compile, and it will become obvious why
> >> your version does not work (hint: DB_PASSWORD <> MY_PASSWORD).
> >>
> >> -Tom.
> >> Microsoft Access MVP
> >>
> >>
> >> >Tom,
> >> >
> >> >Thank you for the quick replies. So, I didn't do exactly what you said but
> >> >it is not getting past the pop-up for the password.
> >> >
> >> >I'm running a non secured database code that would open the other DB that
> >> >has a database password. In that db password protected database is an
> >> >autoexec macro that runs a module. In that module it looks for a /cmd "auto"
> >> >piece that would auto print a report and close the database.
> >> >
> >> >Here is what I have in the unsecured db:
> >> >
> >> >Public Function ITProjectReportTest()
> >> > ITProjectReport
> >> >End Function
> >> >
> >> >Public Function ITProjectReport()
> >> > Const DB_TO_OPEN As String = "l:\access\databases\IT Dept Inventory.mdb"
> >> > Const DB_PASSWORD As String = "Password" ' replaced for this purpose
> >> > Dim objAccess As Access.Application
> >> > Set objAccess = New Access.Application
> >> > objAccess.OpenCurrentDatabase DB_TO_OPEN, False, MY_PASSWORD
> >> >End Function
> >> >
> >> >I run the test module and it pops up the Enter Password box.
> >> >
> >> >Thank you again for all your help....I see light at the end of the tunnel.
> >> >I would love to explore this option but if this is getting too much - I can
> >> >link the tables and copy the report over to the unsecured db
> >> >
> >> >"Tom van Stiphout" wrote:
> >> >
> >> >> On Sat, 19 Dec 2009 10:13:01 -0800, Steven
> >> >> <(E-Mail Removed)> wrote:
> >> >>
> >> >> I played around with OpenDatabase a bit more, and although you can
> >> >> open a DatabasePassword-protected database with it, that database does
> >> >> not run its AutoExec macro, which I'm sure is important to you.
> >> >>
> >> >> So we move on to OpenCurrentDatabase:
> >> >> Create an unsecured database with an AutoExec macro with one line:
> >> >> Action=RunCode, FunctionName=InitApplication()
> >> >>
> >> >> Create a standard module and paste in this code:
> >> >> 'This function is called by AutoExec macro.
> >> >> Public Function InitApplication()
> >> >> Const DB_TO_OPEN As String =
> >> >> "c:\temp\myTestDatabaseWithDbPassword.accdb"
> >> >> Const DB_PASSWORD As String = "myPassword"
> >> >> Dim objAccess As Access.Application
> >> >> Set objAccess = New Access.Application
> >> >> objAccess.OpenCurrentDatabase DB_TO_OPEN, False, MY_PASSWORD
> >> >> End Function
> >> >>
> >> >> Replace myConstants with yours. Close and reopen this db. Observe that
> >> >> it opens the secured db and runs its autoexec macro.
> >> >>
> >> >> -Tom.
> >> >> Microsoft Access MVP
> >> >>
> >> >>
> >> >>
> >> >> >I am confused, obviously.
> >> >> >
> >> >> >I also don't know how to use the information you provided.
> >> >> >
> >> >> >With database password
> >> >> >This is the connection string to use when you have an access database
> >> >> >protected with a password using the Set Database Password function in
> >> >> >Access.Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet
> >> >> >OLEDBatabase Password=MyDbPassword;
> >> >> >
> >> >> >Just copying the access.provider=...into code gives me an error and I don't
> >> >> >know how to call the function.
> >> >> >
> >> >> >Any help would be greatly appreciated.
> >> >> >
> >> >> >Thank you,
> >> >> >
> >> >> >Steven
> >> >> >
> >> >> >"Tom van Stiphout" wrote:
> >> >> >
> >> >> >> On Fri, 18 Dec 2009 19:55:01 -0800, Steven
> >> >> >> <(E-Mail Removed)> wrote:
> >> >> >>
> >> >> >> You are confusing Workgroup security (which requires a username and
> >> >> >> password, and uses the /user, /pwd command line switches) with the
> >> >> >> Database Password (which requires only a password, and for which there
> >> >> >> is no command line switch).
> >> >> >>
> >> >> >> If you REALLY want to do this, you may want to launch an unsecured
> >> >> >> Access app which uses the OpenDatabase method to open your
> >> >> >> password-secured app. The connect string can then contain the
> >> >> >> password. See http://www.connectionstrings.com/access for details.
> >> >> >>
> >> >> >> -Tom.
> >> >> >> Microsoft Access MVP
> >> >> >>
> >> >> >>
> >> >> >>
> >> >> >> >I have a database with a database level password. I want to open the
> >> >> >> >database using 'Scheduled Tasks' and pass the password. I have used the /pwd
> >> >> >> >link and a /User of "Admin" but it is not working. What is the user if I'm
> >> >> >> >using a database password? is there a way to do this?
> >> >> >> >
> >> >> >> >I've searched through hundreds of password questions and can't seem to find
> >> >> >> >it. Any help would be greatly appreciated.
> >> >> >> >
> >> >> >> >Thank you,
> >> >> >> .
> >> >> >>
> >> >> .
> >> >>
> >> .
> >>

> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Line Switch =?Utf-8?B?ZGF2ZQ==?= Microsoft Powerpoint 1 18th May 2005 09:16 PM
Password command line switch ppViewer =?Utf-8?B?U3RldmU=?= Microsoft Powerpoint 8 6th May 2005 06:47 PM
Database Level Password & Command Line =?Utf-8?B?R2FyeSBC?= Microsoft Access 1 3rd May 2004 01:49 AM
Open .mdb database password protected from command line Rahito Yacom Microsoft Access 1 16th Mar 2004 10:18 PM
Re: Command Line Switch /??? Ken Briscoe Windows XP Customization 0 7th Oct 2003 07:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:43 AM.