Speedy
11-12-2003, 09:54 PM
Hi,
I have an inner join statement looking like this:
rs.open "SELECT * FROM competition1 INNER JOIN competition2 ON competition1.ID=competition2.ID WHERE competition1.ID=" & Request("ID")
I get this error message:
It's not possible to use this connection for this task. It's closed
or invalid in this case.
/showplayer.asp line 14
showplayer.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("db\2003.mdb")
set rs=Server.CreateObject("ADODB.recordset")
rs.open "SELECT * FROM competition1 INNER JOIN competition2 ON competition1.ID=competition2.ID WHERE competition1.ID=" & Request("ID")
if rs.eof then
response.write "<hr><center>Databasen är tom</center><hr>"
end if
%>
<center>
<table border="1" style="border-collapse: collapse" bordercolor="#000000" cellspacing="0" cellpadding="2">
<tr bgcolor="#000000">
<td width="50" align="center"><b><font color="#FFFFFF">Pos</font></b></td>
<td width="140" align="left"><b><font color="#FFFFFF">Namn</font></b></td>
<td width="50" align="center"><b><font color="#FFFFFF">Hcp</font></b></td>
<td width="50" align="center"><b><font color="#FFFFFF">V1</font></b></td>
<td width="50" align="center"><b><font color="#FFFFFF">V2</font></b></td>
<td width="50" align="center"><b><font color="#FFFFFF">Tot</font></b></td>
<td width="50" align="center"><b><font color="#FFFFFF">Thcp</font></b></td>
<td width="50" align="center"><b><font color="#FFFFFF">P</font></b></td>
</tr>
<%
dim background
background="#cccccc"
%>
<% do while not rs.eof %>
<%
if background = "#ffffff" then
background = "#cccccc"
else
background = "#ffffff"
end if
%>
<tr bgcolor="<%=background%>">
<td align="center"><%=rs.Fields("pos").Value%></td>
<td align="left"><a href="showplayer.asp?ID=<%=Request.QueryString("ID")%>"><%=rs.Fields("Fname").Value%> <%=rs.Fields("Lname").Value%></a></td>
<td align="center"><%=rs.Fields("hcp").Value%></td>
<td align="center"><%=rs.Fields("r1").Value%></td>
<td align="center"><%=rs.Fields("r2").Value%></td>
<td align="center"><%=rs.Fields("total").Value%></td>
<td align="center"><%=rs.Fields("Thcp").Value%></td>
<td align="center"><%=rs.Fields("Points").Value%></td>
</tr>
<%
rs.movenext
Loop
%>
</table>
</center>
</body>
</html>
<%
set rs = nothing
%>
What I'm trying to do here is to list all info about the player
I click on in a list where the link looks like this
<td align="left"><a href="showplayer.asp?ID=<%=Request.QueryString("ID")%>" target="results"><%=rs.Fields("Fname").Value%> <%=rs.Fields("Lname").Value%></a></td>
Any idea what's wrong?
/Speedy
I have an inner join statement looking like this:
rs.open "SELECT * FROM competition1 INNER JOIN competition2 ON competition1.ID=competition2.ID WHERE competition1.ID=" & Request("ID")
I get this error message:
It's not possible to use this connection for this task. It's closed
or invalid in this case.
/showplayer.asp line 14
showplayer.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("db\2003.mdb")
set rs=Server.CreateObject("ADODB.recordset")
rs.open "SELECT * FROM competition1 INNER JOIN competition2 ON competition1.ID=competition2.ID WHERE competition1.ID=" & Request("ID")
if rs.eof then
response.write "<hr><center>Databasen är tom</center><hr>"
end if
%>
<center>
<table border="1" style="border-collapse: collapse" bordercolor="#000000" cellspacing="0" cellpadding="2">
<tr bgcolor="#000000">
<td width="50" align="center"><b><font color="#FFFFFF">Pos</font></b></td>
<td width="140" align="left"><b><font color="#FFFFFF">Namn</font></b></td>
<td width="50" align="center"><b><font color="#FFFFFF">Hcp</font></b></td>
<td width="50" align="center"><b><font color="#FFFFFF">V1</font></b></td>
<td width="50" align="center"><b><font color="#FFFFFF">V2</font></b></td>
<td width="50" align="center"><b><font color="#FFFFFF">Tot</font></b></td>
<td width="50" align="center"><b><font color="#FFFFFF">Thcp</font></b></td>
<td width="50" align="center"><b><font color="#FFFFFF">P</font></b></td>
</tr>
<%
dim background
background="#cccccc"
%>
<% do while not rs.eof %>
<%
if background = "#ffffff" then
background = "#cccccc"
else
background = "#ffffff"
end if
%>
<tr bgcolor="<%=background%>">
<td align="center"><%=rs.Fields("pos").Value%></td>
<td align="left"><a href="showplayer.asp?ID=<%=Request.QueryString("ID")%>"><%=rs.Fields("Fname").Value%> <%=rs.Fields("Lname").Value%></a></td>
<td align="center"><%=rs.Fields("hcp").Value%></td>
<td align="center"><%=rs.Fields("r1").Value%></td>
<td align="center"><%=rs.Fields("r2").Value%></td>
<td align="center"><%=rs.Fields("total").Value%></td>
<td align="center"><%=rs.Fields("Thcp").Value%></td>
<td align="center"><%=rs.Fields("Points").Value%></td>
</tr>
<%
rs.movenext
Loop
%>
</table>
</center>
</body>
</html>
<%
set rs = nothing
%>
What I'm trying to do here is to list all info about the player
I click on in a list where the link looks like this
<td align="left"><a href="showplayer.asp?ID=<%=Request.QueryString("ID")%>" target="results"><%=rs.Fields("Fname").Value%> <%=rs.Fields("Lname").Value%></a></td>
Any idea what's wrong?
/Speedy