|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Updating access
Hi Im trying to update the password field on an access database via asp this is my code which doesn't work
please help or volunteer an alternative, thanks <% Dim adoCon Dim rsUpdateEntry Dim strSQL Dim Name Dim pass Dim pass1 Dim pass2 'Create an ADO connection object Set adoCon = Server.CreateObject("ADODB.Connection") 'Set an active connection to the Connection object using a DSN-less connection adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("test.mdb") 'Create an ADO recordset object Set rsUpdateEntry = Server.CreateObject("ADODB.Recordset") Name=Request.Form("userName") pass=Request.Form("userPassword") pass1 = Request.Form("userPassword1") pass2 = Request.Form("userPassword2") strSQL="Select * from password where name='" & Name &"' and password='" & pass & "'" 'Set the cursor type we are using so we can navigate through the recordset rsUpdateEntry.CursorType = 2 'Set the lock type so that the record is locked by ADO when it is updated rsUpdateEntry.LockType = 3 'Open the recordset with the SQL query rsUpdateEntry.Open strSQL, adoCon If pass1=pass2 then rsUpdateEntry.Fields("password") = pass1 End If 'Write the updated recordset to the database rsUpdateEntry.Update 'Reset server objects rsUpdateEntry.Close Set rsUpdateEntry = Nothing Set adoCon = Nothing Response.Redirect "./test.asp" %> |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Updating access |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|