| Continue.... |
<%@
LANGUAGE = "VBScript"
%>
<%
Set cnDZ =
Server.CreateObject("ADODB.Connection")
cnDZ.Open "DSN=myDatabase"
%>
<html>
<head><title>players.asp</title></head>
<body>
<%
Set rs =
cnDZ.Execute("SELECT * FROM TABLE")
If Not
rs.EOF Then
Do Until
rs.EOF
If Len(rs("DESCRIP"))
> 50 Then
dot = ".." Else
dot = ""
Response.Write"Player Name: "&rs("PNAME")&"<br>"&_
"Description: "&Left(rs("DESCRIP"),50)&""&dot&"<br><br>"
rs.MoveNext
Loop
Else
Response.Write"Sorry, no records found."
End If
rs.Close
Set rs = Nothing
%>
<br><br><br>
<%
'Or, the second, more intense example
'hyperlinking the record to itself:
specific = Request.QueryString("specific")
If specific =
"" Then
Set rs =
cnDZ.Execute("SELECT PID, PNAME, DESCRIP FROM TABLE ORDER BY PNAME ASC")
If Not
rs.EOF Then
Do Until
rs.EOF
If Len(rs("DESCRIP"))
> 50 Then
dot = " <a href=""players.asp?specific="&rs("PID")&""">Read
More..</a>" Else
dot = ""
Response.Write"Player Name: "&rs("PNAME")&"<br>"&_
"Description: "&Left(rs("DESCRIP"),50)&""&dot&"<br><br>"
rs.MoveNext
Loop
Else
Response.Write"Sorry, no records found."
End If
rs.Close
Set rs = Nothing
Else
Set rs =
cnDZ.Execute("SELECT * FROM TABLE WHERE PID =
"&specific&"")
If Not
rs.EOF Then
Response.Write"Player Name: "&rs("PNAME")&"<br>"&_
"Description: "&rs("DESCRIP")&""
Else
Response.Write"Sorry, that record was not found."
End If
rs.Close
Set rs = Nothing
End If
%>
</body>
</html>