![]() |
Sergey Kornilov admin 4/23/2007 |
Jeremy, |
J
|
jtforstner author 4/23/2007 |
Does this make sense??? |
![]() |
Sergey Kornilov admin 4/24/2007 |
I would create a ViewOnLoad Event and display all those tables in that event. |
J
|
jtforstner author 4/24/2007 |
I would create a ViewOnLoad Event and display all those tables in that event.
|
J
|
Jane 4/25/2007 |
Jeremy, Sub ViewOnLoad() ' Parameters: ' where - string with WHERE clause pointing to record to be viewed str = "select FieldName from DetailTableName where System='Analog' and Lineup=" & dict("Lineup") Set rsTemp = server.CreateObject("ADODB.Recordset") rsTemp.open str, dbConnection Response.write "<table><tr><td>Analog</td></tr>" Response.write "<td><tr>" & rsTemp("FieldName") & "</td></tr></table>" rsTemp.Close : set rsTemp = Nothing End Sub
|
J
|
jtforstner author 4/25/2007 |
Jeremy, here is a sample code: Also you can find some examples on the ASPRunner Forum, in the ASPRunner Help or here: http://webcheatsheet.com/asp/
str = "select * from [CHANNELS] where System='Analog' and Lineup=" & dict("Lineup") |
![]() |
Sergey Kornilov admin 4/25/2007 |
Jemery, |
J
|
jtforstner author 4/25/2007 |
Jemery, unfortunately the code Jane provided is not correct as dict variable is not available in ViewOnLoad event. In this event you can use Request.QueryString("editid1") to access key column value (664 in your example). Use this value to retrieve data related to current record. I hope this helps a little bit. Also when you build SQL queries make sure text values are wrapped by single quote characters.
|
![]() |
Sergey Kornilov admin 4/25/2007 |
Jeremy, strSQL = "select * from TableName where KeyColumn=" & Request.QueryString("editid1") |
J
|
jtforstner author 4/26/2007 |
Please excuse me being a total novice with some of this, I am still learning. I just can't figure this piece out. This is what I came up with... and it is returning the error below it. strSQL = "select * from [FRANCHISE] where KeyColumn=" & Request.QueryString("editid1") Error number -2147217904 Error description [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. URL /interact/interact/FRANCHISE_view.asp SQL query select * from [FRANCHISE] where KeyColumn=402 Solution This error means one of the following:
|
![]() |
Sergey Kornilov admin 4/26/2007 |
Jeremy, |
J
|
jtforstner author 4/26/2007 |
Jeremy, in my sample code I highlighted table and field names that need to be replaced with the actual names. KeyColumn is not a real column name. Other than that code looks pretty good.
|
J
|
Jane 4/27/2007 |
Jeremy, strSQL = "select from [FRANCHISE]where KeyColumn=" & Request.QueryString("editid1") set rsLineup = server.CreateObject("ADODB.Recordset") rsLineup.open strSQL, dbConnection str = "select from [CHANNELS] where System='Analog' and Lineup='" & rsLineup("LINEUP")& "'" Set rsTemp = server.CreateObject("ADODB.Recordset") rsTemp.open str, dbConnection Response.write "<div align=center><table border=0 width=200><tr><td colspan=2 align=center><b>ANALOG</b></td></tr>" do while not rsTemp.eof Response.write "<tr><td align=center bgcolor=#E4EBEC width=30>" & rsTemp("ChannelNbr") & "</td><td bgcolor=#E4EBEC align=left>" & rsTemp("ChannelName") & "</td></tr>" rsTemp.MoveNext loop Response.write "</table></div>" rsTemp.Close : set rsTemp = Nothing |
J
|
jtforstner author 4/27/2007 |
Jane you're my hero! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=17376&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' /> |
J
|
jtforstner author 4/27/2007 |
Jane you're my hero! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=17379&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' /> One last question, is there a way to make sure that the output is sorted by rsTemp("ChannelNbr") in ascending order? Thank you! Thank you!
|