This topic is locked

link to record - #2

5/23/2004 02:07:49
ASPRunnerPro General questions
B
bronoman author

I'm using ASPRunner 2.4 with a SQL Server 2000.

I have other static pages on my intranet where I would like to create a hyperlink to a specific record within the ASP "edit" page. Is this possible?
what I'm trying to get to an individual record is the following URL

http://intranet/test/incident/incident_edi...p?incidentID=70
incidentID is my primary key
unfortunately, I get:
ASP error happened
Technical information

Error number -2147217900

Error description [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '='.

URL /test/incident/incident_edit.asp

SQL query select incidentID,caller ,reportedHW ,location ,department ,phone ,shortDescription ,longDescription ,errorMessage ,category ,severity from [dbo].[incident] where incidentID=
I followed instructions in a previous posting by JAGwebdev / topic: link to record very precisely but still can't get it to work. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=619&image=1&table=forumtopics' class='bbc_emoticon' alt=':(' />
Any ideas ?
Thank you!

Matt

Sergey Kornilov admin 5/24/2004

Matt,
please post here actual code snippet where you read incidentID from Request.QueryString and modify WHERE clause.

B
bronoman author 5/24/2004

Hi,

here is an update on my problem. I re-iterated through the previous posting once more and also looked a littlebit into the code. Here is what I found:
I guess the URL must be:

http://intranet/.../incident_edit.asp?action=view&EditID=3388


(so there must be a specific reference to "EditID" - no matter what the name of the database field is)
also on your notes from the other posting, here are some further remarks:

You need to move this portion of code to the very begining of edit.asp file.


 

<%

if Request.QueryString("EditID")<>"" then

strEditID = Request.QueryString("EditID")

else

strEditID = Request.Form("EditID")

end if

%>



close - this line must be right after the first line which is

<%@ Language=VBScript %>


and replace all occurencies of Request.Form("EditID") (except the above one) with strEditID.


I also replaced all instances of

request.form("editid")

with strEditID
I tweaked the action parameter a little in the following lines: (added part in italic)

   if myaction="view" [I]or myaction="" [/I]then _

     myaction="edit"



now, all of this works fine - except if there is a login (which is the case in here)

the workaround I placed for this is the following: (added in italic)

<%

If Session("UserID")="" [I]and Request.QueryString("EditID")="" [/I]Then

Response.Redirect "incident_worklist_login.asp"

End If

%>


unfortunately the record is only saved if a succesfull login has been completed in the session.
Any ideas if I'm on the right track here and how I can bypass the login just for the "direct access" ?
thanks,

Matt

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=1945&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' />

500117 4/9/2005

Where in the code do I specify which field am I passing as parameter? I am doing what you suggested here but I get this error.
select [], [StartDate], [StartTime], [EventName], [Location] from [EventsWeeklyQRY] where []=Maroone of Weston''s Movie in the Park - SNOW DOGS
The field passed as parameter is blank. The value is passed Ok but it doens't know where to put it.
Thanks!

Sergey Kornilov admin 4/12/2005

I would recommend to use ASPRunnerPro 3.2 that supports direct links to the Edit page.