Solved

How to send username and password to a secured website using VBA

Posted on 2006-11-29
2
643 Views
Last Modified: 2008-03-17
Dear Experts,

I'm trying to pass a username and password to a secured website using ms access.
I have tried passing the values in the URL (stURL = "Http://" & stSUser & ":" & stSPass & "@" & stURL_Root) and tried to pass the values using SendKeys while Internet Explorer has the focus.
In the first case (passing values in URL) IE returns the "Page cannot be displayed" error, while username and password are correct.
In the second case the logon dialog opens but the username is not pasted into the Dialog box :

On Error Resume Next
    Set Ie = CreateObject("InternetExplorer.Application")
        With Ie
           .Navigate stURL_Root
           .Visible = True
     End With
Sendkey stPaste 'string for userid has been copied to the clipboard

Can anybody help me with this issue?

Thanks and regards, Johan
0
Comment
Question by:jrameuwissen
  • 2
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 18035799
Does the website support passing the username and password in the URL? If so, you'd need to contact them to find out the exact syntax to use, but most sites that do support this use syntax like this:

http:\\www.website.com?username=scott&password=mcdaniel

or something similar.

If you're trying to "automate" the webpage and add your username and password via VBA, then the short answer is you really cannot do this. There is no way to automate a webpage, except through methods exposed by the webpage ...
0
 
LVL 84
ID: 18049553
Can I ask why a B? You haven't replied to this, and the comment I provided was pretty exact ... you might not like the answer, but the answer is correct.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 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

14 Experts available now in Live!

Get 1:1 Help Now