ASP Source Code:
<%@ Language = VBScript %>
<%option explicit%>
<html>
<head>
<title>SQL Example</title>
<link rel="stylesheet" href="/core.css">
</head>
<body>
<!--#include virtual="header.html"-->
<center><h1>Jumping to a given record</h1></center>
<p>
This demonstrates jumping to a particular record. The
<a href="source.asp?file=<%= right(Request.ServerVariables("PATH_INFO"), len(Request.ServerVariables("PATH_INFO"))-instrrev(Request.ServerVariables("PATH_INFO"), "/")) %>">source</a>
is pretty straight forward.
</p>
<p>
<%
Const adUseClient = 3
dim count, oConn, oRs, offset
SET oConn = Server.CreateObject("ADODB.Connection")
if oConn = null then
abort()
end if
oConn.Open "DSN=qcd;UID=qsql;Password=pa$$w0rd;"
if oConn = null then
abort()
end if
set oRs = oConn.Execute("SELECT * FROM EMPLOYEE_MASTER")
' Move to the last 10 records
offset = 114
response.write "Starting at record " & offset & "<br><br/>" & vbCrLf
oRs.Move offset
' Print out the records
WHILE NOT oRs.EOF
response.write oRs.Fields("FIRST_NAME").Value & " " & _
oRs.Fields("LAST_NAME").Value & "<br/>" & vbCrLf
oRs.MoveNext
WEND
%>
</p>
<!--#include virtual="footer.html"-->
</body>
</html>
© 1999-2019, Qantel Technologies, Inc.
|