hi there, i've been posting messages here since yesterday and i just can do what i want.
I want to update records from the form values on one page(detail.asp), the SQL Update is on the sucessfull update page(update.asp).
I'm going to put the code for the two pages here, please help me.
--------------
Detail.asp
--------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
dim sColect, conn, sqlSearch
sColect = Request("Colect"
%>
<% set conn = Server.CreateObject("adodb.connection"
conn.open "dsn=direct"
'Procura na tabela member os dados carregados na variavél strSearch
Set sqlSearch = conn.Execute("SELECT * FROM member WHERE ((Colect Like '%" & sColect & "%'));"
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
dim strColect, strPass, strPass2, strFut, strId
strId = sqlSearch("Id"
strColect = sqlSearch("Colect"
strPass = sqlSearch("Password"
strPass2 = sqlSearch("Password2"
strFut = sqlSearch("Futebol"
%>
<input type="hidden" name="Id" value="<%=strId%>">
<table>
<tr>
<td colspan="2"><div align="center"><font size="5"><em><strong>Dados da
Colectividade</strong></em></font></div></td>
</tr>
<tr>
<td width="173"><strong>Nome:</strong></td>
<td width="108">
<input name="Colect" type="text" value="<%=strColect%>" disabled size="20"></td>
</tr>
<tr>
<td><strong>Password:</strong></td>
<td>
<label>
<input name="Pass" type="text" value="<%=strPass%>" size="20">
</label></td>
</tr>
<tr>
<td><strong>Password2:</strong></td>
<td>
<label>
<input name="pass2" type="text" value="<%=strPass2%>" size="20">
</label></td>
</tr>
<tr>
<td><strong>Futebol:</strong></td>
<td>
<input type="checkbox" value="ON" <% if strFut = sim then Response.Write("checked"
%>></td>
</tr>
</table>
<form name="form1" method="post" action="update.asp?Colect=<%=sColect%>">
<label>
<input type="submit" name="Submit" value="Update">
</label>
</form>
<p> </p>
</body>
</html>
--------------
Update.asp
--------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
dim conn, supdate, spass, spass2, scolect, sId
iId = Request("Id"
scolect = Request("Colect"
spass = Request("pass"
spass2 = Request("pass2"
response.write(iId)
set conn = Server.CreateObject("ADODB.Connection"
conn.open "dsn=direct"
set sUpdate = conn.execute("Update member set Password='" & spass & "',Password2='" & spass2 & "' Where(Id like '" & iId & "')"
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div align="center">
<p><font size="5">You information has been Updated </font></p>
<p> </p>
<p> </p>
<p></p>
</div>
</body>
</html>
Please see the code and help find the error.
I want to update records from the form values on one page(detail.asp), the SQL Update is on the sucessfull update page(update.asp).
I'm going to put the code for the two pages here, please help me.
--------------
Detail.asp
--------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
dim sColect, conn, sqlSearch
sColect = Request("Colect"
%>
<% set conn = Server.CreateObject("adodb.connection"
conn.open "dsn=direct"
'Procura na tabela member os dados carregados na variavél strSearch
Set sqlSearch = conn.Execute("SELECT * FROM member WHERE ((Colect Like '%" & sColect & "%'));"
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
dim strColect, strPass, strPass2, strFut, strId
strId = sqlSearch("Id"
strColect = sqlSearch("Colect"
strPass = sqlSearch("Password"
strPass2 = sqlSearch("Password2"
strFut = sqlSearch("Futebol"
%>
<input type="hidden" name="Id" value="<%=strId%>">
<table>
<tr>
<td colspan="2"><div align="center"><font size="5"><em><strong>Dados da
Colectividade</strong></em></font></div></td>
</tr>
<tr>
<td width="173"><strong>Nome:</strong></td>
<td width="108">
<input name="Colect" type="text" value="<%=strColect%>" disabled size="20"></td>
</tr>
<tr>
<td><strong>Password:</strong></td>
<td>
<label>
<input name="Pass" type="text" value="<%=strPass%>" size="20">
</label></td>
</tr>
<tr>
<td><strong>Password2:</strong></td>
<td>
<label>
<input name="pass2" type="text" value="<%=strPass2%>" size="20">
</label></td>
</tr>
<tr>
<td><strong>Futebol:</strong></td>
<td>
<input type="checkbox" value="ON" <% if strFut = sim then Response.Write("checked"
</tr>
</table>
<form name="form1" method="post" action="update.asp?Colect=<%=sColect%>">
<label>
<input type="submit" name="Submit" value="Update">
</label>
</form>
<p> </p>
</body>
</html>
--------------
Update.asp
--------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
dim conn, supdate, spass, spass2, scolect, sId
iId = Request("Id"
scolect = Request("Colect"
spass = Request("pass"
spass2 = Request("pass2"
response.write(iId)
set conn = Server.CreateObject("ADODB.Connection"
conn.open "dsn=direct"
set sUpdate = conn.execute("Update member set Password='" & spass & "',Password2='" & spass2 & "' Where(Id like '" & iId & "')"
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div align="center">
<p><font size="5">You information has been Updated </font></p>
<p> </p>
<p> </p>
<p></p>
</div>
</body>
</html>
Please see the code and help find the error.