Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Send data from form to webpage

Posted on 2007-11-29
8
Medium Priority
?
757 Views
Last Modified: 2009-04-01
I have an access database that is used as a "one-stop-shop" if you will for all resources that my team uses. One thing that I want to do is have each user store their username and password for a specific website in the database. Then create a link on a form that they can click on, and they will automatically be logged into the website using the credentials they stored in the database.

I have created a customized login HTML webpage for this website where all of the input fields are hidden and the login form is set to submit on page load. The only problem I am having is getting the login data from MS Access to the webpage.

The custom HTML page is stored on a local server. I tried creating a link in MS ACCESS like:

\\myserver\folder1\folder2\login.html?username=[username]&password=[password]

and sending the login data to the webpage that way and then pulling it into the webpage with javascript but it doesn't work. Is this because I am trying to launch the webpage from a local server and not a web server? Is there another way to do this?

This topic covers several areas so I will try to assign it as best as possible.
0
Comment
Question by:MDauphinais1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 38

Accepted Solution

by:
PaulHews earned 2000 total points
ID: 20373633
Assuming you want them to be able to browse the secured website after logging in, then the only way to login is through the browser.  

If they are using IE, you may be able to use automation to fill in fields in a login page and submit.  If they are using firefox, you may be stuck with a "SendKeys" type of solution.

IE automation(basic example):

Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "http://localhost/login.html"
IE.Visible = True
Do Until IE.ReadyState = 4
Loop
IE.Document.All.Item("txtUsername").Value = "user"
IE.Document.All.Item("txtPassword").Value = "pass"
IE.Document.All.Item("btnSubmit").Click
0
 

Author Comment

by:MDauphinais1
ID: 20374572
Thanks PaulHews, that'll work great!

Is there a way to force the webpage to open on top of everything else? Right now it is opening minimized in the taskbar.
0
 
LVL 8

Expert Comment

by:Barry62
ID: 20374987
Window.SetOrder(IE.hWnd,  HWND_TOPMOST)
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

Author Comment

by:MDauphinais1
ID: 20375035
I get an error requiring an = sign.
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 20375048
Really?  When I run the sample code above it shows the window over my app window.

You can set position for the IE object:

IE.Left = 20
IE.Top = 20
IE.Height = 600
IE.Width = 800

You can also try something like:

AppActivate IE.Document.Title & " - Windows Internet Explorer"
0
 

Author Comment

by:MDauphinais1
ID: 20375190
PaulHews, with the AppActivate IE flashes in front for a second and then ducks back behind MS Access. Modifying the width, height, etc. just keeps it beind the whole time like before.
0
 
LVL 38

Assisted Solution

by:PaulHews
PaulHews earned 2000 total points
ID: 20375287
Sounds like Access doesn't want to lose focus... Try:
Option Explicit
Private Declare Function SetWindowPos Lib "user32" _
         (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
          ByVal x As Long, ByVal y As Long, ByVal cx As Long, _
          ByVal cy As Long, ByVal wFlags As Long) As Long
 
    Private Const SWP_NOSIZE = &H1
    Private Const SWP_NOMOVE = &H2
    Private Const HWND_TOPMOST = -1
    Private Const HWND_NOTOPMOST = -2
 
Private Sub Command1_Click()  'Whatever sub you need it in'
    Dim IE As Object
 
    Set IE = CreateObject("InternetExplorer.Application")
    IE.Navigate "http://localhost/login.html"
    
    Do Until IE.ReadyState = 4
    Loop
    
    SetWindowPos IE.hwnd, HWND_TOPMOST, 100, 0, 600, 800, vbNormalFocus
    IE.Visible = True
    
    IE.Document.All.Item("txtUsername").Value = "user"
    IE.Document.All.Item("txtPassword").Value = "pass"
    IE.Document.All.Item("btnSubmit").Click
 
  
End Sub

Open in new window

0
 

Author Comment

by:MDauphinais1
ID: 20375882
That works perfectly!  Thank you.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

604 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