hej,
när jag försöker hämta data från en tabell, vinsttips enligt nedan
får jag följande felmeddelande:
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal.
/sitetips2004/sitetipswww/siteboard/vinsttips.asp, line 46
där rad 46 är följande rad i utdraget nedan:
<td class="site-lank" onClick=window.open("<%=oRecSet("url")%>"); width="400" align="left"><%=oRecSet("arrangor")%></td>
Jag har hittat info enligt följande....
The error occurs in one of two situations:
You try to access a field in the fields collection that is not in the Recordset
You try to access a field using an ambiguous name.
men tycker att det borde funka eftersom dessa finns med som fält i tabellen vinsttips.
<%
Const NumOfSites = 10
Function ListSites(SQLStmt, NumOfSites, startID)
Dim olddate
Dim writtentable
Set oRecSet = Server.CreateObject("ADODB.Recordset")
SQLStmt2 = "SELECT COUNT(*) as Antal FROM vinsttips"
oRecSet.Open SQLStmt2, strConn, 3, 3
intAntal = oRecSet("Antal")
oRecSet.Close
Alla = intAntal / NumOfSites
Alla = int(Alla) -- 1
Sida = startID / NumOfSites
Sida = int(Sida) -- 1
Set oRecSet = Server.CreateObject("ADODB.Recordset")
oRecSet.Open SQLStmt, strConn, 3, 1
If oRecSet.EOF = False Then
Do While oRecSet.EOF = False
If olddate <> oRecSet("datum") Then
writtenTable = 0
%>
<table width="570" border="0" cellspacing="0" cellpadding="0">
<%End If '' olddate <> oRecSet("datum") %>
<tr onMouseOver="this.style.backgroundColor='#F0F0F0';" onMouseOut="this.style.backgroundColor='';">
<td class="site-ovrigt" width="100" align="left"><%=oRecSet("datum")%></td>
<td class="site-lank" onClick=window.open("<%=oRecSet("url")%>"); width="400" align="left"><%=oRecSet("arrangor")%></td>
<td class="site-lank" onClick=window.open("<%=oRecSet("direkturl")%>"); width="400" align="left"><%=oRecSet("uppgift")%></td>
<td class="site-ovrigt" width="100" align="left"><%=oRecSet("vinst")%></td>
<td class="site-ovrigt" width="100" align="left"><%=oRecSet("slutdatum")%></td>
</tr>