Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Dropdown with usernames from database using Frontpage

Posted on 2006-06-23
4
Medium Priority
?
236 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
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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

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

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
Geo-targeting is the practice of distributing content based on a person’s location, as best as you can determine it. Let’s look at some ways you could successfully use this tactic. The following tips and case studies could lead to meaningful results.
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

885 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