User1642748295 posted
Hi
I have a page which you can add records to the database and works fine.
However, what I am trying to do now is create an edit record page by clicking on the record number.
For example
Page 1 displays
ID
|
Cheque No
|
Date
|
Payee
|
Description
|
ClaimID & P.O.
|
Amount
|
Action
|
Notes
|
|
4567890
|
22/04/09
|
ray
|
paid
|
4567
|
£400,000,000.00
|
on hold
|
waiting on work completion
|
So when they click on ID 12 the url changes to post the link to the next page (
http://myurlco.uk/raytest1.asp?id=12 )
I have now got the next page to display the variable 12, but the variable does not give me the record result 12, it just gives me all of them and I cant work out the correct variable to search the database.
Example of page 2 (Editing Page)
12
ID |
ChqNo |
Date |
Payee |
Description |
ClaimId_po |
Amount |
Action |
Notes |
10 |
45678` |
22/02/09 |
e3w |
e2w |
ty67u8 |
3888 |
basildon |
basildon |
11 |
56789876 |
22/04/09 |
dws |
dws |
test1 |
4000000 |
paid |
paid |
12 |
4567890 |
22/04/09 |
ray |
paid |
4567 |
400000000 |
on hold |
waiting on work completion |
Here is the code for the page 2 (Editing page), please could anyone help me.....Thanks in advance.
---------------------CODE-------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/RayTest.asp" -->
<%
Dim Recordset1
Dim Recordset1_cmd
Dim Recordset1_numRows
Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
Recordset1_cmd.ActiveConnection = MM_RayTest_STRING
Recordset1_cmd.CommandText = "SELECT * FROM Basildon"
Recordset1_cmd.Prepared = true
Set Recordset1 = Recordset1_cmd.Execute
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<% Dim variable
variable=Request.QueryString("id")
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<p>
<% Response.Write variable %>
</p>
<p> </p>
<p> </p>
<table border="0">
<tr>
<td>ID</td>
<td>ChqNo</td>
<td>Date</td>
<td>Payee</td>
<td>Description</td>
<td>ClaimId_po</td>
<td>Amount</td>
<td>Action</td>
<td>Notes</td>
</tr>
<% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) %>
<tr>
<td><%=(Recordset1.Fields.Item("ID").Value)%></td>
<td><%=(Recordset1.Fields.Item("ChqNo").Value)%></td>
<td><%=(Recordset1.Fields.Item("Date").Value)%></td>
<td><%=(Recordset1.Fields.Item("Payee").Value)%></td>
<td><%=(Recordset1.Fields.Item("Description").Value)%></td>
<td><%=(Recordset1.Fields.Item("ClaimId_po").Value)%></td>
<td><%=(Recordset1.Fields.Item("Amount").Value)%></td>
<td><%=(Recordset1.Fields.Item("Action").Value)%></td>
<td><%=(Recordset1.Fields.Item("Notes").Value)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
-----------CODE---------------
Mike