+ Reply to Thread
Results 1 to 2 of 2

Macro to automatically hit database using password

Hybrid View

  1. #1
    Registered User
    Join Date
    08-10-2007
    Posts
    51

    Macro to automatically hit database using password

    Team!,

    Hi! Currently, I have a database schema where I am hitting approximately 10 different tables. Using the OpenDatabase method, I am able to successfully query the information via Microsoft Query and return the results via VBA.

    The current issue I have at hand is the manual password entry. For example, when Excel executes this line of code:

    Set Open_DB1 = Workbooks.OpenDatabase(filename:="C:\" & numstuds_compliant)

    , a window loads up specifying me to log in using my Username and Password. What I essentially want to accomplish is the ability to automate the entry of my username and password in the password-protected schema.

    Alternatively, I tried using this command from the help of links from Google:

    Set Open_DB = Workbooks.OpenDatabase(filename:="C:\" & numstuds, ReadOnly:=True, Connect:=";PWD=testingabc")

    and when I attempt to run my vba script, I receive a compile error "Named Argument not found ReadOnly:=

    I then tried removing the ReadOnly:=True and I then receive the same compile error, but this time, highlighting the Connect:= issue.

    Is this because I am using an Oracle Database (Microsoft ODBC for Oracle)? The whole point of my Executive Report generation for Senior management is so that when the open up the workbook, all they need to do is click "Run" and the results/charts/graphs are displayed to them without the intervention of any manual password entry.

    As this project is critical in its life cycle, any help and/or suggestions will be greatly appreciated.

  2. #2
    Registered User
    Join Date
    08-10-2007
    Posts
    51

    doesn't anyone know this answer?? (EOM) - !!!

    doesn't anyone know this answer?? (EOM) - !!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1