Guest_imported
New member
- Jan 1, 1970
- 0
I have a page that displays all the records in the database on an html page. For each record the road field is a hyperlink. When this link is clicked on a form is brought up with all the data from that record which the user can modify.
What I would like is, instead of a page that brings up all the records in the database, I want a little form that will allow me to search for a particular record, which I can then modify.
The code I have at the moment is below. What code do I need to add to make the search facility?
<html>
<head>
<title>Modifying Records</title>
<link rel="stylesheet" href="index.css" type="text/css">
</head>
<body bgcolor="White" link="Red" vlink="Yellow" alink="Yellow">
<%
set conn=Server.CreateObject("adodb.connection"
conn.open "property"
set rs=Server.CreateObject("adodb.Recordset"
sqlstmt = "SELECT * from details"
rs.open sqlstmt, conn
If rs.eof then
response.write "No records"
response.write "<br>Try again
Else
%>
<h4> Modifying Records</h4>
<table width="600" border="0" cellpadding="10">
<%
Do while not rs.eof
property_id = rs("property_id"
road = rs("road"
area = rs("area"
postcode = rs("postcode"
location = rs("location"
weekly_rental = rs("weekly_rental"
list_text = rs("list_text"
detail_text = rs("detail_text"
imageone = rs("imageone"
imagetwo = rs("imagetwo"
number_bedrooms = rs("number_bedrooms"
furnished = rs("furnished"
%>
<tr>
<td>
<a href="modify2.asp?property_id=<%= property_id %>"><font size="3"><%= Road %></font></a>
</td></tr><tr>
<td><%= area %></td></tr><tr>
<td><%= postcode %></td></tr><tr>
<td><%= location %></td></tr><tr>
<td><%= number_bedrooms %></td></tr><tr>
<td><%= furnished %></td></tr><tr>
<td>£<%= weekly_rental %>/wk</td></tr><tr>
<td><%= list_text %></td></tr><tr>
<td><%= detail_text %></td></tr><tr>
<td><%= imageone %></td></tr><tr>
<td><%= imagetwo %><p><hr></td>
</tr>
<%
rs.MoveNext
loop
End If
%>
</table>
</center>
</body>
</html>
Many thanks
James
What I would like is, instead of a page that brings up all the records in the database, I want a little form that will allow me to search for a particular record, which I can then modify.
The code I have at the moment is below. What code do I need to add to make the search facility?
<html>
<head>
<title>Modifying Records</title>
<link rel="stylesheet" href="index.css" type="text/css">
</head>
<body bgcolor="White" link="Red" vlink="Yellow" alink="Yellow">
<%
set conn=Server.CreateObject("adodb.connection"
conn.open "property"
set rs=Server.CreateObject("adodb.Recordset"
sqlstmt = "SELECT * from details"
rs.open sqlstmt, conn
If rs.eof then
response.write "No records"
response.write "<br>Try again
Else
%>
<h4> Modifying Records</h4>
<table width="600" border="0" cellpadding="10">
<%
Do while not rs.eof
property_id = rs("property_id"
road = rs("road"
area = rs("area"
postcode = rs("postcode"
location = rs("location"
weekly_rental = rs("weekly_rental"
list_text = rs("list_text"
detail_text = rs("detail_text"
imageone = rs("imageone"
imagetwo = rs("imagetwo"
number_bedrooms = rs("number_bedrooms"
furnished = rs("furnished"
%>
<tr>
<td>
<a href="modify2.asp?property_id=<%= property_id %>"><font size="3"><%= Road %></font></a>
</td></tr><tr>
<td><%= area %></td></tr><tr>
<td><%= postcode %></td></tr><tr>
<td><%= location %></td></tr><tr>
<td><%= number_bedrooms %></td></tr><tr>
<td><%= furnished %></td></tr><tr>
<td>£<%= weekly_rental %>/wk</td></tr><tr>
<td><%= list_text %></td></tr><tr>
<td><%= detail_text %></td></tr><tr>
<td><%= imageone %></td></tr><tr>
<td><%= imagetwo %><p><hr></td>
</tr>
<%
rs.MoveNext
loop
End If
%>
</table>
</center>
</body>
</html>
Many thanks
James