Hi
I have 2 problems I am dealing with.! I am paging through recodset but the data isn't align with my title. How can I correct that problem? 2) How can I make the tickect number and display as a link?
Once I have that completed I can have them display the data on another page.
I am new to asp any help is greatly appreciated.
Thanks
R.M
code:
Eta Call back Database
Ticket Number Status First Name Last Name Phone Number Account Number Customer Comment
Code:
<% @LANGUAGE = VBScript %>
<%Option Explicit
Response.Expires = 0
Const adOpenStatic = 3
Const adLockReadOnly = 1
Const adCmdText = &H0001
%>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Eta Call back Database</title>
</head>
<body>
<p align="center">Eta Call back Database</p>
<p align="center"> </p>
<p align="center"> </p>
<%
Dim objConn, objRS, strQ, objProp
Dim strconnection
Dim iPageSize
Dim iPageCount
Dim iPageCurrent
Dim strOrderBy
Dim strSQL
Dim objPagingConn
Dim objPagingRS
Dim iRecordsShown
Dim iFieldCount
Dim iRecordCount
Dim LoopRecordCount
Dim pageNum
Dim counter
Dim markShowPage
Dim I, J
iPageSize = 6
If Request.QueryString("page") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("page"))
End If
strSQL ="SELECT * from Escalation_Forms order by Ticket_Number asc;"
Set objPagingConn = Server.CreateObject("ADODB.Connection")
strConnection = "Provider=sqloledb;Data Source=FLMIRSQL02;"
strConnection = strConnection & "User ID=Source_Forms_User;Password=password;"
objPagingConn.Open strConnection
Set objPagingRS = Server.CreateObject("ADODB.Recordset")
objPagingRS.PageSize = iPageSize
objPagingRS.CacheSize = iPageSize
objPagingRS.Open strSQL, objPagingConn, adOpenStatic, adLockReadOnly, adCmdText
iPageCount = objPagingRS.PageCount
iFieldCount = objPagingRS.Fields.Count
iRecordCount = objPagingRS.RecordCount
If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
If iPageCurrent < 1 Then iPageCurrent = 1
If iPageCount = 0 Then
Response.Write "No records found!"
Else
objPagingRS.AbsolutePage = iPageCurrent
Dim arrDBData
ReDim arrDBData(iFieldCount, iRecordCount)
LoopRecordCount = 0
'arrDBData = objPagingRS.GetRows()
Do While LoopRecordCount < iPageSize And Not objPagingRS.EOF
For I = 0 To objPagingRS.Fields.Count - 1
arrDBData(I, LoopRecordCount) = objPagingRS.Fields(I)
Next
LoopRecordCount = LoopRecordCount + 1
objPagingRS.MoveNext
Loop
objPagingRS.Close
Set objPagingRS = Nothing
objPagingConn.Close
Set objPagingConn = Nothing
End If
iRecordCount = iRecordCount - 1
iFieldCount = iFieldCount - 1
LoopRecordCount = LoopRecordCount - 1
pageNum = Round(iRecordCount/iPageSize)
If pageNum < (iRecordCount/iPageSize) Then pageNum = pageNum + 1
Response.Write " <b>Page: "
For counter = 1 To pageNum
if counter=iPageCurrent then
Response.Write " <span class=activepage> "
Response.Write counter
Response.Write " </span>"
markShowPage=1
else
Response.Write " <a onclick=exitoff() href=Eta_database.asp?page="
Response.Write counter
Response.Write " class=listingLink>"
Response.Write counter
Response.Write "</a>"
end if
Next
Response.Write "</b>"
Response.Write " "
Response.Write "<b>"
Response.Write "<a href=Eta_database.asp?page="
If iPageCurrent = 1 Then
Response.Write pageNum
else
Response.Write iPageCurrent-1
end if
Response.Write " class=listingLink>Back</a> "
Response.Write "<a href=Eta_database.asp?page="
If iPageCurrent = pageNum Then
Response.Write "1"
else
Response.Write iPageCurrent+1
end if
Response.Write " class=listingLink>Next</a>"
Response.Write "</b>"
%>
<table border="1">
<%
For I = 0 To LoopRecordCount
Response.Write "<tr>" & vbCrLf
For J = 0 To ifieldCount
Response.Write vbTab & "<td>" & arrDBData(J, I) & "</td>" & vbCrLf
Next ' J
Response.Write "</tr>" & vbCrLf
Next ' I
%>
</table>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
td {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
listingLink {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: blue;
text-decoration:none;
margin-left:0px;
margin-right:0px;
}
a.listingLink:hover {
color:#FF0000;
}
activepage {
color:#ffffee;
background-color: #000033;
font-weight: bold;
}
</style>