?
Solved

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

Posted on 2006-11-29
2
Medium Priority
?
667 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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1500 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 85
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

850 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