473,803 Members | 3,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

from combo box data - > Open website with username and password

99 New Member
I have a form with a combo box called "cmbWebsite s".

The combo box row source comes from a select query that returns rows:

0.WebsiteID
1.Website Name
2.Website URL
3.Username
4.Password

Only "Website Name" appears in the combo box. The other columns are set to zero length.

When the user selects a website, the AfterUpdate event will trigger code to build a string that contains the URL, Username and Password of the selected website, and runs it through the FollowHyperlink method.

The only thing I don't know how to do is format the hyperlink so the websites will accept the username and password and automatically get me into the site; like "Roboform".

Even though this isn't a pure MS Access question, I can't imagine that other Access developers haven't done something similar.

Does anyone know how to format a URL with Username and Password, so the FollowHyperlink method automatically gets you into the site?

Thanks,
Adam
Oct 30 '09 #1
12 5424
mshmyob
904 Recognized Expert Contributor
@AdamOnAccess
I guess that would depend on the format that the Web site requires. For instance I have a map button for my addresses and I open a google map to display my contacts driving directions. The string I send to google maps is based on their format.

I also retrieve stock and index indormation from numerous sites but they require me to pass a string in a certain syntax.

All you need to figure out is what syntax the site expects and do something like so:

Expand|Select|Wrap|Line Numbers
  1. Dim strURL As String
  2. strURL = "http://maps.google.com/maps?q=" & txtAddrStreet & ",+" & txtAddrCity & ",+" & txtAddrProv & "+" & txtAddrPostal & "+" & txtAddrCountry
  3. Application.FollowHyperlink strURL
  4.  
cheers,
Oct 30 '09 #2
AdamOnAccess
99 New Member
mshmyob,

Thanks for the reply. I know I need the format, but I was thinking that perhaps there was some kind of "standard" for usernames and passwords. Are you familiar with the program, "Roboform". It maintains usernames and passwords for any site you choose. Just click a button, and it stores the URL, username and password. When you want to return to the site, you just click it and in you go. How does Roboform manage to send usernames and passwords to ANY website without first knowing the format?

There must be some standard way to do this. Any one know how?

-Adam
Oct 30 '09 #3
NeoPa
32,579 Recognized Expert Moderator MVP
I'm not familiar with RoboForm Adam, but from your own description, it seems that it holds it per site. I expect it determines the format from usage somehow (and stores it with your username and password in its database). I certainly think (no great expert at this to be sure so don't take as gospel) that Mshmyob is on the right lines with this though.
Oct 31 '09 #4
mshmyob
904 Recognized Expert Contributor
I will try and look into it this weekend. I have done a little research and thrown something together but I am having a few errors. Give me a couple of days and I will see what I can come up with if anything.

cheers,
Oct 31 '09 #5
ADezii
8,834 Recognized Expert Expert
I'm not sure of the specific syntax, but you may be able to use the ExtraInfo Parameter of the FollowHyperlink Method to accomplish this.
Oct 31 '09 #6
ADezii
8,834 Recognized Expert Expert
@AdamOnAccess
Just retrieve the Username and Password Control Names as well as the Form Name from the Web Site (View Source), and you should be OK:
Expand|Select|Wrap|Line Numbers
  1. Dim objIE As Object
  2. Set objIE = CreateObject("InternetExplorer.Application")
  3.  
  4. With objIE
  5.   .Visible = True
  6.   .Navigate "<Your Web Site>"
  7.  
  8.    Do While .ReadyState <> 4
  9.      DoEvents
  10.    Loop
  11.  
  12.    With .Document.Forms(0)
  13.      .UserName.Value = "your login"         'Retrieve Control Name from Web Page
  14.      .Password.Value = "your password"      'Retrieve Control Name from Web Page
  15.        .Document.loginForm.submit           'Retrieve Form Name from Web Page
  16.    End With
  17. End With
Oct 31 '09 #7
ADezii
8,834 Recognized Expert Expert
I've developed some code that is slightly convoluted, does not require advance knowledge of any Control/Form Names, and actually worked very well during many trials. It involves the use of the FollowHyperlink Method, SendKeys, and the Sleep() API Function. You can judge for yourself:
  1. Declare the API Function:
    Expand|Select|Wrap|Line Numbers
    1. Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
  2. Execute the following code block:
    Expand|Select|Wrap|Line Numbers
    1. Const conWEB_ADDRESS As String = "<YaDa, YaDa, YaDa>"
    2. Const conUSERNAME As String = "<more YaDa, YaDa>"
    3. Const conPASSWORD As String = "<still more YaDa, YaDa>"
    4.  
    5. Application.FollowHyperlink Address:=conWEB_ADDRESS
    6.  
    7. Sleep (3000)    'Delay 3 seconds
    8. SendKeys conUSERNAME, True      'Plug in User Name
    9.  
    10. Sleep (1000)    'Delay 1 second
    11. SendKeys "{TAB}", True          'Send the TAB Keystroke
    12.  
    13. Sleep (1000)    'Delay 1 second
    14. SendKeys conPASSWORD, True      'Plug in Password
    15.  
    16. Sleep (1000)    'Delay 1 second
    17. SendKeys "{TAB}", True          'Send the TAB Keystroke
    18.  
    19. Sleep (1000)    'Delay 1 second
    20. SendKeys "{ENTER}"              'Send the ENTER Keystroke 
NOTE: You can experiment with the Delays for better performance.
Oct 31 '09 #8
mshmyob
904 Recognized Expert Contributor
Here is a simple way of submitting your username and password to various sites.

Expand|Select|Wrap|Line Numbers
  1. ' you need a reference to the Microsoft HTML Object Library
  2. Dim webBrowser As Object
  3. Set webBrowser = CreateObject("InternetExplorer.Application")
  4.  
  5. With webBrowser
  6.     .Navigate "put your login URL here"
  7.     .Visible = True
  8.         ' loop until the page has finished loading
  9.         Do While webBrowser.readyState <> 4
  10.            DoEvents
  11.         Loop
  12.        ' username and password are the default element names - if they are different you need to figure them out and change accordingly
  13.        .Document.all.Item("USERNAME").Value = "your username"
  14.        .Document.all.Item("PASSWORD").Value = "your password"
  15. End With
  16.  
cheers,
Nov 1 '09 #9
AdamOnAccess
99 New Member
Mshmyob, ADezii, NeoPa,

Thanks all! Lot's of great stuff to work with here. My biggest problem now is deciding which solution is best? It seems the real tricky part here is capturing the object names for username and password in the html form. I suppose I could create fields in the database to store that info, use view page to capture the actual names, and then slug them in when I run the code.

Not the kind of thing I'd expect most users to pull off. I could set "Username" and "Password" as default field names and that will probably cover most of it.
Thanks again!

-Adam
Nov 4 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2769
by: |-|erc | last post by:
Hi! Small challenge for you. The index.php uses this file and calls layout(). Take a look at www.chatty.net this file draws the chat login box on the right. I traced the CHAT button it submits and goes to the index file again, I can't figure out how it opens the chatroom. I want to get it to skip the login box and go straight to the room, with user name "guest" or "" or whatever but I'll add a field to type the name in the chat room....
8
1974
by: rikesh | last post by:
Hi I'm sure this is a very trivial problem! I have a combo bound to a recordset. I was wondering how I can show the value on the page, what the user has selected? The code that I'm using is below. Any help, would be much apprceciated. Kind regards
0
10329
by: hlabbott | last post by:
Hi I'm having a problem displaying attachments correctly. I have messages with attachments stored on Exchange2000 and want to be able to click a hyperlink in my project like in OWA and see an attachment. Because it is stored on Exchange I have to set a username and password so I do a GET request. The data I get back seems to still be encoded - trying to open an excel file for example results in it trying to open it but an excel...
11
2427
by: Patrick | last post by:
I have an ASP.NET application that connects to a SQL Server database. The SQL Server resides on a seperate development server from the IIS5.1 on Windows XP SP2 on development PCs which host the ASP.NET application. I would like to use Integrated Windows Authentication like Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DBName;Data Source=DevServer1 My problems!
3
3785
by: hary08 | last post by:
im doing a database for Hospital Admission, I have a log in form which prompt user for a password. The source of log in is to look for the values in my Table tblEmployees and match user name and password entered.My case now is I have Audit Trail Module which keeps records of modifications and current user, I wanted my audit trail to log the current user based on who has log from based on my Log in Form.please help ty HERES THE CODE FOR ON...
2
2567
by: SFM | last post by:
I just want a simple datareader, that i can read the value returned from a select statement executed on a SQL server 2005 db. The code below should work in, but email= rdr.ToString(); when i want to read some data a get a exception saying: System.InvalidOperationException was unhandled by user code Message="Invalid attempt to read when no data is present." Source="System.Data" StackTrace:
3
3018
by: jambonjamasb | last post by:
Hi I have two tables: email_tbl Data_table Data table is is used to create a Form Data_form
3
1890
by: Faisal Shah | last post by:
As the solution.. I have got this script code.. it's an open source so i can modify it.. The problem is it's a guest book script written in very highly and deeply php language that I am not able to understand all.. BUT I am here you guys can read and help me.. From this script i would need your help, You will have to separate 2 things <PLEASE> 1. Bunch of code, Which writes message and gives a unique id to each entry...SO identified...
4
4283
by: tokcy | last post by:
HI every one, i am using tooltip on click of link and i want like when that tooltip open then background window would be blure(). can anyone help me...
0
9700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9564
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10546
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10292
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9121
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6841
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.