|
|
|
|
|
| | |
|
Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Desperate for help...asp and access for one time passwords... |
From: |
Joel Holtzman |
Date: |
1/6/2000 4:10:45 PM |
IP: |
216.102.148.4 |
Hello and thanks for your time. Here is the situation. I am almost there...
I need to create a one time password system for an online test. So, the student does know the password and puts it in and goes to the test.
Then, if they try to cheat and use it again, or give it to another test taker, the second time it is used it is no good.
Heres the problem.
Microsoft Access. Name of table: passwords
Two Fields:
Password: Text display where the passwords are stored
HasTaken: Yes/No display used to determine if user has taken the test or not.
Here is the script that comes close but just doesnt quite do the job:(redirect first time passwords to test, and prevent second time use)
<%
This page will check the database for the
correct password and see if that password
has already been used.
This is always a good idea.
Dim Myconn
Dim rst
Dim result
Dim pwd
Retrieve the password from the form (this page).
pwd = Request.Form("Password")
If the form hasnt been submitted then bypass this
If pwd <> "" Then
Connect to the database
Set Myconn = Server.CreateObject("ADODB.Connection")
conString = "DBQ=" & Server.MapPath("test.mdb")
Myconn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & conString
Create a recordset object and load all of the records from the database.
Set rst = Server.CreateObject("ADODB.Recordset")
rst.open "Select * From passwords", Myconn
rst.MoveFirst
Search for the password
End If
If rst("Password") = pwd Then
Response.Redirect "test.asp" ÿLM/W3SVC/3/Root |
Follow Up - Somethings missing, was cut off... - Joel Holtzman 1/6/2000 4:12:13 PM
|
|

|
|
|
|
|
|
|
|
|
|