-2

Connection file

<%
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open "abc","ID","Password"
    conn.commandtimeout=120

    Set RS = Server.CreateObject("ADODB.RecordSet")
    rs.activeConnection = Conn

%>

Classic ASP file

<%response.buffer = true%>
<%Response.Expires = 0%>
<!-- #include file="functions.asp" -->

<% Response.Write session("RequestID")%>
<%if session("ValidLogon") <> "true" then
    if request("FromEmail") = "True" then
        SetSessVar()
    else%>
        <%response.redirect "Default.asp"
    end if
end if%>

<html>
<body>

<%rs.Source = "SELECT * from tblRequests WHERE RequestID = " & request("requestID")

rs.Open

session("RequestID") = rs("requestid")

if rs("RequestType") = "O" then

    response.clear

    If request("Tag") = "Change" then
        response.redirect "abc.asp#change"
    else
        response.redirect "abc.asp?From=" & request("From")
    end if

else

    response.clear

    If request("Tag") = "Change" then
        response.redirect "editinternal.asp#change"
    else
        response.redirect "editinternal.asp?From=" & request("From")
    end if

end if
rs.close%>

</body>
</html>

I have checked the classic asp page and it looks like there is an error in syntax inside "Body" tag. I don't know anything about it.

It is giving internal server error 500.

Community
  • 1
  • 1
Amit
  • 1
  • 1
  • 1
  • Would be helpful if you provided the full 500 error, what line does it occur on and what is the error description? – user692942 Jan 14 '16 at 11:55
  • Do you know how to configure IIS to give detailed error messages for classic asp? http://www.chestysoft.com/asp-error-messages.asp – John Jan 15 '16 at 10:43
  • @John- I don't know about it. Could you please help me? – Amit Jan 16 '16 at 09:07
  • John's provided a link to an article that details setting up detailed errors in IIS, have you looked at it? – user692942 Jan 16 '16 at 09:39

3 Answers3

0

In Connection File you are missing Set on rs.activeConnection = Conn as you are setting an object reference to the ADODB.Connection object instance not passing a connection string.

'Object instances require Set
Set rs.activeConnection = Conn
user692942
  • 16,398
  • 7
  • 76
  • 175
  • @Amit Well then what is the error, the full description?!? How do you expect us to help? Unbelievable, that was definitely a problem but you likely have more then one issue with your code. Can't just keep guessing though. – user692942 Jan 15 '16 at 07:34
0

Please make sure that you configure your site to send the detailed error messages to the client

This describes how: Show detailed errors

I would guess that your connection "abc"/"ID"/"Password" has to be a real connection. It seems that you just wrote something to see what happens. It could also be the "functions.asp" file that you are including. Does that file exist, what does it contain?

Please post back your detailed error messages, then we can help you better.

Community
  • 1
  • 1
Lars Meldgård
  • 1,074
  • 10
  • 6
0

Before referencing to the recordset you should check if the recordset contains any records like:

If not rs.eof then
  Session("reqestid") = rs("reqestid")
  ....
End If

Just want to add one trix here, try add these 2 lines right after the body tag

Response.Write "<br>For the sake of debug"
Response.Flush

If you have buffering on, this sometimes writes out the error instead of throwing out error 500. Helps me often.

Johannes
  • 21
  • 4