Maximus007
Technical User
When I move the pointer over the link that dipslays Next Page it show the following URL address: & Page=2 and when I click on it. It dipslays the following
How can I remove the single quote form status?
<%@ Language=VBScript %>
<%Option Explicit %>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 2</title>
</head>
<body>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000" width="985" height="50" id="table1" bgcolor="#000000">
<tr>
<td width="983" height="50" align="center">
<img border="0" src="LogoMasthead.gif" align="left" width="150" height="45"><img border="0" src="header_level3.jpg" width="828" height="48"></td>
</tr>
</table>
</center>
</div>
<p align="center">
<font face="Impact, Arial, Helvetica, Sans Serif" size="+3">
Database Result </font>
<p align="center">
<font size="6">
<%
Dim objConn, objRS, strSQL
Dim SqlStatus, Sqlselected
Dim nItemsPerPage, nPage, nPageCount
nItemsPerPage =2
set objConn=Server.CreateObject("ADODB.CONNECTION")
ObjConn.Open "Provider=sqloledb;Data Source=Flmirsql02;Initial Catalog=Source_Forms;User Id=Source_Forms_User;Password=password;"
Sqlselected = Request("Escalation_Type")
'SqlStatus =Request("Status")
If Len(Request.Form("Escalation_Type")) <> "" Then
SqlStatus = " And Status = '" & request("Status") & "'"
Else
SqlStatus = 0
End If
Set ObjRS = Server.CreateObject("ADODB.Recordset")
ObjRS.CursorLocation = 3 ' adUseClient
strSql = "SELECT * FROM Escalation_Forms WHERE Escalation_Type = '"& Sqlselected & "'" & SqlStatus
objRS.Open strSql, objConn, 0, 1
Response.Write(strSql)
Response.End
if objRS.eof then
Response.Write ("No records match your request!")
End if
' Set the page size of the recordset
objRS.PageSize = nItemsPerPage
' Response.Write(nItemsPerPage)
'Response.end
' Get the number of pages
nPageCount = ObjRS.PageCount
nPage = CLng(Request.QueryString("Page"))
If nPage < 1 Or nPage > nPageCount Then
nPage = 1
End If
%></font><b><font size="6"> </font>
</b>
<p align="center">
<table border="2">
<tr>
<th bgcolor="#000000"><font color="#FF0000"><strong>Ticket Number</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>Escalation Type</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>First Name</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>Last Name</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>Account Number</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>Phone Number</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>CAE Name</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>Customer Comment</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>Status</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>Feed Back</strong></font></th>
</tr>
<%
' Position recordset to the correct page
ObjRS.AbsolutePage = nPage
Do While Not (ObjRS.Eof Or ObjRS.AbsolutePage <> nPage)
'Loop through the records here
'Show records
Response.Write ("<tr>")
Response.Write("<td><a href='Results.asp?TicketNum=" & objRS("Ticket_Number") & "'>" & objRS("Ticket_Number")& "</a></td>")
Response.Write "<td>" & objRS("Escalation_Type") &"</td>"
Response.Write "<td>" & objRS("First_Name") &"</td>"
Response.Write "<td>" & objRS("Last_Name") & "</td>"
Response.Write "<td>" & objRS("Account_Number") & "</td>"
Response.Write "<td>" & objRS("Phone_Number") & "</td>"
Response.Write "<td>" & objRS("Cae_Name") & "</td>"
Response.Write "<td>" & objRS("Cust_Com") & "</tr></td>"
Response.Write "<td>" & objRS("Status") & "</td>"
Response.Write "<td>" & objRS("Wip_Com") & "</td>"
ObjRS.MoveNext
Loop
%>
</table><br>
<%
' First page
'Response.Write "<A HREF=""Start3.asp?Escalation_Type=" & Sqlselected & " & Page=1"">First Page</A>"
' Next page
if CInt(nPage) <> CInt(nPageCount) then
Response.Write "<A HREF=""Start3.asp?Escalation_Type=" & server.htmlencode(Sqlselected) &""& Server.HtmlEncode(SqlStatus) &"&Page=" & nPage + 1 & """>Next Page </A><br><br>"
End if
' Previous page:
if nPage > 1 then
Response.Write "<A HREF=""Start3.asp?Escalation_Type=" & server.htmlencode(Sqlselected) &""& Server.HtmlEncode(SqlStatus) &" &Page=" & nPage - 1 & """>Previous Page </A>"
End if
' Last page
'Response.Write "<A HREF=""Start3.asp?Escalation_Type=" & server.htmlencode(Sqlselected) & "&Page=" & nPageCount & """>Last Page</A>"
'Close Data Access Objects and free DB variables
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
<p>
<span style="vertical-align: middle; font-weight: 700">
<b>
<a href=" to Main Menu</a>
</b> </span></p>
</body>
</html>
How can I remove the single quote form status?
<%@ Language=VBScript %>
<%Option Explicit %>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 2</title>
</head>
<body>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000" width="985" height="50" id="table1" bgcolor="#000000">
<tr>
<td width="983" height="50" align="center">
<img border="0" src="LogoMasthead.gif" align="left" width="150" height="45"><img border="0" src="header_level3.jpg" width="828" height="48"></td>
</tr>
</table>
</center>
</div>
<p align="center">
<font face="Impact, Arial, Helvetica, Sans Serif" size="+3">
Database Result </font>
<p align="center">
<font size="6">
<%
Dim objConn, objRS, strSQL
Dim SqlStatus, Sqlselected
Dim nItemsPerPage, nPage, nPageCount
nItemsPerPage =2
set objConn=Server.CreateObject("ADODB.CONNECTION")
ObjConn.Open "Provider=sqloledb;Data Source=Flmirsql02;Initial Catalog=Source_Forms;User Id=Source_Forms_User;Password=password;"
Sqlselected = Request("Escalation_Type")
'SqlStatus =Request("Status")
If Len(Request.Form("Escalation_Type")) <> "" Then
SqlStatus = " And Status = '" & request("Status") & "'"
Else
SqlStatus = 0
End If
Set ObjRS = Server.CreateObject("ADODB.Recordset")
ObjRS.CursorLocation = 3 ' adUseClient
strSql = "SELECT * FROM Escalation_Forms WHERE Escalation_Type = '"& Sqlselected & "'" & SqlStatus
objRS.Open strSql, objConn, 0, 1
Response.Write(strSql)
Response.End
if objRS.eof then
Response.Write ("No records match your request!")
End if
' Set the page size of the recordset
objRS.PageSize = nItemsPerPage
' Response.Write(nItemsPerPage)
'Response.end
' Get the number of pages
nPageCount = ObjRS.PageCount
nPage = CLng(Request.QueryString("Page"))
If nPage < 1 Or nPage > nPageCount Then
nPage = 1
End If
%></font><b><font size="6"> </font>
</b>
<p align="center">
<table border="2">
<tr>
<th bgcolor="#000000"><font color="#FF0000"><strong>Ticket Number</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>Escalation Type</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>First Name</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>Last Name</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>Account Number</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>Phone Number</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>CAE Name</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>Customer Comment</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>Status</strong></font></th>
<th bgcolor="#000000"><font color="#FF0000"><strong>Feed Back</strong></font></th>
</tr>
<%
' Position recordset to the correct page
ObjRS.AbsolutePage = nPage
Do While Not (ObjRS.Eof Or ObjRS.AbsolutePage <> nPage)
'Loop through the records here
'Show records
Response.Write ("<tr>")
Response.Write("<td><a href='Results.asp?TicketNum=" & objRS("Ticket_Number") & "'>" & objRS("Ticket_Number")& "</a></td>")
Response.Write "<td>" & objRS("Escalation_Type") &"</td>"
Response.Write "<td>" & objRS("First_Name") &"</td>"
Response.Write "<td>" & objRS("Last_Name") & "</td>"
Response.Write "<td>" & objRS("Account_Number") & "</td>"
Response.Write "<td>" & objRS("Phone_Number") & "</td>"
Response.Write "<td>" & objRS("Cae_Name") & "</td>"
Response.Write "<td>" & objRS("Cust_Com") & "</tr></td>"
Response.Write "<td>" & objRS("Status") & "</td>"
Response.Write "<td>" & objRS("Wip_Com") & "</td>"
ObjRS.MoveNext
Loop
%>
</table><br>
<%
' First page
'Response.Write "<A HREF=""Start3.asp?Escalation_Type=" & Sqlselected & " & Page=1"">First Page</A>"
' Next page
if CInt(nPage) <> CInt(nPageCount) then
Response.Write "<A HREF=""Start3.asp?Escalation_Type=" & server.htmlencode(Sqlselected) &""& Server.HtmlEncode(SqlStatus) &"&Page=" & nPage + 1 & """>Next Page </A><br><br>"
End if
' Previous page:
if nPage > 1 then
Response.Write "<A HREF=""Start3.asp?Escalation_Type=" & server.htmlencode(Sqlselected) &""& Server.HtmlEncode(SqlStatus) &" &Page=" & nPage - 1 & """>Previous Page </A>"
End if
' Last page
'Response.Write "<A HREF=""Start3.asp?Escalation_Type=" & server.htmlencode(Sqlselected) & "&Page=" & nPageCount & """>Last Page</A>"
'Close Data Access Objects and free DB variables
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
<p>
<span style="vertical-align: middle; font-weight: 700">
<b>
<a href=" to Main Menu</a>
</b> </span></p>
</body>
</html>