Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Gm3512 #1
return data on a table from a text box
I have a form with a textfield. When I enter a number in it and hit submit in
the form I want the information to update the table that is in the form. So I
want to return the records from the recorset that = the value that is in the
textbox. The query is correct, I am just not sure how to make this happen on
the same page. Can someone please point me in the right direction.
The code is below.
Thanks Greg
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/mytestupdtdb.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.Form("tb_rectext") <> "") Then
Recordset1__MMColParam = Request.Form("tb_rectext")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_mytestupdtdb_STRING
Recordset1.Source = "SELECT * FROM TestTable WHERE RecText = '" +
Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form action="" method="get" name="form1">
<p>
<input name="tb_recText" type="text" id="tb_recText">
</p>
<table width="200" border="1">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<tr>
<td><%=(Recordset1.Fields.Item("RecID").Value)%> </td>
<td><%=(Recordset1.Fields.Item("RecText").Value)%> </td>
<td><%=(Recordset1.Fields.Item("RecNum").Value)% ></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
<p> </p>
</form>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
Gm3512 Guest
-
How to take data out of table, restructure the table and then put the data back in
Hi All Wonder if you could help, I have a bog standard table called STOCKPRICES that has served me well for a while, but now I need to change the... -
Trouble copying data from old table to new table
Hello all, I am working with a ColdFusion MX 6.1 frontend and a SQL Server 2000 backend - There is a "CUSTOMER_INFO" table for every month and... -
How to return a resultset/table from a sql function?
Hi, Is it possible to return the following (parameterized) qyery from a sql or plpsql function, and if so, what is the syntax? SELECT{ (SELECT... -
query to return table structure
hi, Is there any command or query that returns the table structure informix. -
Changing a html table when new data is entered into SQL table.
Hi all, I was wondering if anyone has any ideas on how I would go about this task. What I have is a html table which is populated from 2 different...



Reply With Quote

