|
Got it figured out. I just did it through a hidden field. Here is the code if intersted
<% Dim mode 'Dimension Variables Dim strUserName 'Holds the name of the user Dim userID Dim adoCon 'Holds the Database Connection Object Dim rsAdmin 'Holds the recordset for the records in the database Dim strSQL 'Holds the SQL query to query the database
userID = Request.querystring("ID")
If Request.querystring("mode") = "changepassword" then
'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("site.mdb")
'Create an ADO recordset object Set rsAdmin = Server.CreateObject("ADODB.Recordset")
strUserID = Request.Form("txtID") strPassword = Request.Form("txtPassword")
'Initialise the strSQL variable with an SQL statement to query the database strSQL = "UPDATE tblUsers SET tblUsers.password='" & strPassword & "' WHERE ID =" & strUserID
'Open the recordset with the SQL query rsAdmin.Open strSQL, adoCon
Set rsAdmin = Nothing Set adoCon = Nothing Response.Redirect"main.asp"
End If
Response.Write ("<table align='right'><tr><td><a href='main.asp'><img src='images/home2_324.gif' alt='Home' border='0'></a></td><td><a href='profile.asp?mode=view'><img src='images/search_16.gif' alt='View Profile' border='0'></a></td><td><a href='profile.asp?mode=edit'><img src='images/save_16.gif' alt='Edit Profile' border='0'></a></td><td><a href='profile.asp?mode=password'><img src='images/security.gif' alt='Change Password' border='0'></a></td><td><a href='logout.asp'><img src='images/Log-Off_324.gif' alt='Logoff' border='0'></a></td></tr>") Response.write ("<tr><td></td><td><a href='admin.asp?mode=add'><img src='images/add_account.gif' alt='Add Account' border='0'></a></td><td><a href='admin.asp?mode=admin'><img src='images/add_admin.gif' alt='Add Admin' border='0'></a></td><td><a href='admin.asp?mode=listusers'><img src='images/editaccounts.gif' alt='Edit Accounts' border='0'></a></td><td><a href='admin.asp?mode=reports'><img src='images/reports.gif' alt='Reports' border='0'></a></td></tr></table> <br><br><br><br>") Response.Write ("<form name='Profile' method='post' action='changepass.asp?mode=changepassword'>") Response.Write ("<br><b>Change Password</b><br><br>") Response.Write ("<input type='Password' name='txtPassword'>") Response.Write ("<input type=hidden value='" & userID & "' name='txtID'><br><br><br>") Response.Write ("<input type='image' src='images/submit3.jpg' name='Submit' value='Enter' alt='Enter'>") Response.Write ("</form>") Response.Write ("<br><br><a href=main.asp><img src='images/back_16.gif' border='0' alt='Go Back'></a>") %>
|