Results 1 to 8 of 8

Thread: Access Report - Help needed urgently

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Brunei
    Posts
    100

    Unhappy

    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.

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    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.

  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    So, did it work?

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Brunei
    Posts
    100
    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

  5. #5
    Lively Member
    Join Date
    Feb 1999
    Location
    Austin,TX,USA
    Posts
    98
    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

  6. #6

  7. #7
    Lively Member
    Join Date
    Feb 1999
    Location
    Austin,TX,USA
    Posts
    98
    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>

  8. #8
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    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
  •  



Click Here to Expand Forum to Full Width