View Single Post
Old 09-18-2012, 11:15 PM   PM User | #7
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
THIS is what you were not doing in the first two code postings:
Code:
 <%=RS("kpname")%>
Look at your own code (here on multiple lines for clarity):
Code:
wshell.run "D:/InCharge8T2/SAM.Adapters/smarts/bin/sm_arclient.exe " _
          & " --server=""remedyserver"" --user=""smartsid"" --password=""smartsid"" " _
          & " createEntry ""InCharge SAM Schema""  2 c ""smarts"" 7 e 1  8 c  """ _
          & KPname & """  1042601003 c ""Server"" 1042601004 c ""exchange-server"" " _
          & " 1042601007 d ""Paging File Usage High; Paging File Usage% is 98.84; >TH = 95"" "
See? You were using the BARE VARIABLE NAME kpname.

And that variable came from THIS LINE in your code:
Code:
kpname = ChkString(Request.QueryString("kpname"))
And, as I previously pointed out, since you are *NOT* passing that in the ACTUAL querystring from the first page, it will of course be BLANK!

***********

Again...MAKE UP YOUR MIND. You *CAN* pass kpname in the querystring from the first page, if you wish. Easy to change the code on the first page to do so.

Or you can get it from the recordset.

But it makes no sense to create the recordset and than just ignore the value from the recordset.

Personally, I would get rid of all the sql on that second page, if the ONLY purpose is to get kpname, and just pass kpname in the querystring.

You do that in your FIRST PAGE by changing this code:
Code:
        <a href="test5.asp?parenteventid=<%response.write rsqdb("parenteventid")%>">
        <%response.write rsqdb("ParentEventID")%></a>
to this:
Code:
<%
        ' you *REALLY* need to URLEncode when you put stuff in a query string:
        eid = Server.URLEncode(rsqdb("parenteventid"))
        kpname = Server.URLEncode(rsqdb("kpname"))
%>        
        <a href="test5.asp?parenteventid=<%=eid%>&kpname=<%=kpname%>">
            <%=rsqdb("ParentEventID")%>
        </a>
Oh...and do learn to use <%=xxx%> in place of <%response.write xxx%>. It makes no difference to ASP but it makes your code tons easier to read and write.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote