This topic is locked

old search to edit field event not working with 4.1

11/2/2006 9:18:10 PM
ASPRunnerPro General questions
S
SteveL author

Hi I had this event before where I could go directly to the edit page by searching on the list page.

here is the code below

---------

Sub ListOnLoad()

if Request("action")="Search" then
' open recordset using strSQL parameter

set rstmp = Server.CreateObject("ADODB.Recordset")

rstmp.Open strSQL, dbConnection

' fetch the first row and redirect to the appropriate Edit page

if not rstmp.eof then

response.redirect "GPRS_CarReader_Testing_edit.asp?editid=" & rstmp("CarReaderSerialNum")

rstmp.close : set rstmp = nothing

end if
end if

End Sub

-------------------

this worked fine with my old project on 4.0 however when I try using Asp4.1 this code doesnt work and it takes me to the list page still.

any ideas?

thanks
Steve

Sergey Kornilov admin 11/2/2006

Try the following:

Sub ListOnLoad()

if REQUEST("a")="search" then
' open recordset using strSQL parameter

set rstmp = Server.CreateObject("ADODB.Recordset")

rstmp.Open strSQL, dbConnection

' fetch the first row and redirect to the appropriate Edit page

if not rstmp.eof then

response.redirect "GPRS_CarReader_Testing_edit.asp?editid=" & rstmp("CarReaderSerialNum")

rstmp.close : set rstmp = nothing

end if
end if

End Sub

S
SteveL author 11/3/2006

hi sergey i tried the code below and it still doesnt work.

it takes me to the following URL when i search for an item
http://168.143.116.20/GPRSSQL/GPRS_CarRead...st.asp?a=return
any ideas?

thanks

Try the following:

S
SteveL author 11/6/2006

hi sergey just giving this issue a bump i tired what you said and it still doesnt work. still goes straight to the list page... any ideas?

thanks

Sergey Kornilov admin 11/6/2006

Send me your files. There is nothing I can do just looking at this code.