Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dropdown with usernames from database using Frontpage

Posted on 2006-06-23
4
Medium Priority
?
235 Views
Last Modified: 2013-12-24
What I would like is on my login page have the usernames displayed in a dropdown list.  The user can choose their username from the list and then type in their password.

The database is called admin.mdb and the field I want to display is username

Thanks
0
Comment
Question by:Shaft960
[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 Comments
 
LVL 2

Accepted Solution

by:
Eme-Eleonu earned 2000 total points
ID: 16986877
Just plug this into your page

<!-- Start First Drop Down -->
<%
Set objDC = Server.CreateObject("ADODB.Connection")
objDC.Open Application("login_connectionstring")
Set objRS = objDC.Execute("SELECT Distinct username FROM Table")
%>
<FORM METHOD="POST" NAME="Form1">
<font face="Arial">Choose Your
    Username </font>
<SELECT NAME="username" SIZE="1" ONCHANGE=Form1.submit()>
<option selected><% = Request.Form("username") %></option>
<%
' Continue until we get to the end of the recordset.
Do Until objRS.EOF
' For each record we create a option tag and set it's value to the Department
%>

<OPTION><%= objRS("username") %></OPTION>
            <%
      ' Get next record
      objRS.MoveNext
      Loop
      %>
      </SELECT> </p>
      </FORM>
<%
' Close Data Access Objects and free DB variables
objRS.Close
Set objRS =  Nothing
objDC.Close
Set objDC = Nothing
%>
<!-- End first Drop Down -->

<!--Password Field-->
<%
'Some code to hide the password until we make a username is selected from the first
IF Request.Form("username") = "" Then
Else
'If username has a value then we allow user to enter password
%>
<FORM METHOD="POST" NAME="Form2">
<input type="password" name="Password" size="20">
<%
'Set a hidden value in the second form for the username
'so we can pass it along with the city to the next query %>
<input type="submit" value="Log In Now" name="Submit">
<input type="hidden" name="username" value="<% = Request.Form("username") %>"
</FORM>
<% End IF %>
<!-- End -->
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

715 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