|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
RE:username & password
Thanks Memnoch,
The majority of this code is working. However I am having problems when I try to assign a password that the particular user has entered. Do until results.eof 'There were records in the database that match the username 'Check if password field is empty If(results("PasswordField") = "") Then 'Password field is empty results("PasswordField")=Password results.Update End If results.movenext Loop I have included the code highlighted in red, but the password is not saving to the database. I just cant figure out the problem. I would really appreciate help with this... Thank You |
|
#2
|
||||
|
||||
|
How many records are you wanting to update...You should verify that only one record was return before you start trying to update the database, otherwise you might accidently update all the records.
|
|
#3
|
||||
|
||||
|
Here is how I would do it
Code:
Set Conn = Server.CreateObject("ADODB.Connection")
Set results = Server.CreateObject("ADODB.Recordset")
Conn.Open "Your ConnectionString"
Username = Request.Form("Username")
Password = Request.Form("Password")
sqlSelect = "SELECT * FROM Logins WHERE Username = '" & Username & "'"
results.Open sqlSelect, Conn, 3, 3, 1
If(results.recordcount = 1) Then
Conn.Execute("UPDATE Logins SET Password = '" & Password & "' WHERE UserID = " & results("UserID"))
Else
'More than one record was returned
End If
Conn.Close
Set results = nothing
Set Conn = nothing
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > RE:username & password |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|