I need to capture the id of the record set to enable the edit button to go to the edit page displaying details of that record.
It is in an array which writes out the headings of the table then each row with an edit button (hyperlink with image - which should capture the id of that record, appending it to the hyperlink which will open the edit page for that record when the edit button is clicked.) at the beginning of each row of the table.
I cannot get it to work - can anyone help please:
Below is the function that creates the table:
function GetReport(chosenview)
'response.Write chosenview
sViews = chosenview
dim i, i2, intCounter,sArray,sText,strColor
intCounter = 0
sSql = "SELECT * from dbo.[" & sViews & "]"
'response.write sSql
'response.End
objRs.Open sSql, objConn, 3,3'adOpenStatic, adLockReadOnly, adCmdText
strColor = "white"
'create start of html table for data
if (not objRS.eof) OR (not objRS.bof) then
'if (not objRS.eof) then
sArray = objRS.GetRows()
response.write "<p>" & Ubound(sArray,2)+1 & " record(s)</p>"
response.write "<p><table id=""tablerecs"" border=""1"" cellpadding=""2"" cellspacing=""1"">"
response.write "<tr style=""background-color:#9999cc;"">"
'first row is header row
response.write "<th class=""smalltd""> </th>"
for i = 0 to objRS.fields.count-1
response.write "<th class=""smalltd""><b>" & objRS.fields(i).Name & "</b></th>"
next
response.write "</tr >"
'add table data rows
'the HREF below is the section that doesn't work, i have included two of my trys.
intCounter = Ubound(sArray,2)
'response.write "<td class=""smalltd""><a title=""Click to edit this record"" href="" d="& sArray(i2,i) &"&from=drilldown"" >" & "<img src=""/Images/edit.gif"" height=""15"" width=""28"" /></a></td>"
or
response.write "<tr><td class=""smalltd""><a title=""Click to edit this record"" href="" "& sArray(i).value & "><img src=""/Images/edit.gif"" height=""15"" width=""28"" /></a></td>"
' records - id is the first field in the recordset
for i2 = 0 to Ubound(sArray,1)
sText = isnullval(sArray(i2,i))
response.write "<td class=""smalltd"">" & sText & "</td>"
next
response.write "</tr>"
next
response.write "</table>"
Many thanks!
It is in an array which writes out the headings of the table then each row with an edit button (hyperlink with image - which should capture the id of that record, appending it to the hyperlink which will open the edit page for that record when the edit button is clicked.) at the beginning of each row of the table.
I cannot get it to work - can anyone help please:
Below is the function that creates the table:
function GetReport(chosenview)
'response.Write chosenview
sViews = chosenview
dim i, i2, intCounter,sArray,sText,strColor
intCounter = 0
sSql = "SELECT * from dbo.[" & sViews & "]"
'response.write sSql
'response.End
objRs.Open sSql, objConn, 3,3'adOpenStatic, adLockReadOnly, adCmdText
strColor = "white"
'create start of html table for data
if (not objRS.eof) OR (not objRS.bof) then
'if (not objRS.eof) then
sArray = objRS.GetRows()
response.write "<p>" & Ubound(sArray,2)+1 & " record(s)</p>"
response.write "<p><table id=""tablerecs"" border=""1"" cellpadding=""2"" cellspacing=""1"">"
response.write "<tr style=""background-color:#9999cc;"">"
'first row is header row
response.write "<th class=""smalltd""> </th>"
for i = 0 to objRS.fields.count-1
response.write "<th class=""smalltd""><b>" & objRS.fields(i).Name & "</b></th>"
next
response.write "</tr >"
'add table data rows
'the HREF below is the section that doesn't work, i have included two of my trys.
intCounter = Ubound(sArray,2)
'response.write "<td class=""smalltd""><a title=""Click to edit this record"" href="" d="& sArray(i2,i) &"&from=drilldown"" >" & "<img src=""/Images/edit.gif"" height=""15"" width=""28"" /></a></td>"
or
response.write "<tr><td class=""smalltd""><a title=""Click to edit this record"" href="" "& sArray(i).value & "><img src=""/Images/edit.gif"" height=""15"" width=""28"" /></a></td>"
' records - id is the first field in the recordset
for i2 = 0 to Ubound(sArray,1)
sText = isnullval(sArray(i2,i))
response.write "<td class=""smalltd"">" & sText & "</td>"
next
response.write "</tr>"
next
response.write "</table>"
Many thanks!