Hej!
Riktar val detta till m_soderlund som har gjort exempelsidan med hur man gor Paging med GetRows()!
Iaf, far foljande felmess:
Microsoft VBScript compilation (0x800A03EE)
Expected ')'
/forumet/forum.asp, line 32, column 32
pagecount = ((posts-1) \ Pz -- 1
Eftersom jag inte ar sa haj an pa GetRows() sa kanske jag har strulat till det?
Har ar hela min kod:
[red]
<%
Dim forum, strSql, rs, page
Call DBConn()
forum = request.querystring("id")
page = Request.Querystring("page")
If page="" Then page=1
rowcount=0
strSql = "Select threadID, threadUser, threadLastReply, threadAns, ThreadAvailable, threadForumID"&_
"From t_threads where threadForumID = "&forum
set rs = objConn.execute(strSql)
If rs.eof then
response.write "Inga trådar i detta forum"
Call DBClose()
Else
With rs
.Close
.Cursortype= 3
.Open
.Pagesize= 10
End With
rs.absolutePage = cInt(page)
posts = rs.recordCount
Pz = rs.PageSize
pagecount = ((posts-1) \ Pz -- 1
arrRecs = rs.GetRows(Pz)
rs.close : Set rs = nothing
Call DBClose()
response.write "<table width=""100%"" bgcolor=""#EFEFEF""><tr><td>Trådar</td></tr></table>"
If IsArray(arrRecs) Then
For i = 0 To UBound(arrRecs,2) And rowcount < Pz
posts(0) = arrRecs(0,i)
posts(1) = arrRecs(1,i)
posts(2) = arrRecs(2,i)
posts(3) = arrRecs(3,i)
posts(4) = arrRecs(4,i)
posts(5) = arrRecs(5,i)
posts(6) = arrRecs(6,i)
response.write "<table width=""100%"" bgcolor=""#FFFFFF"">"&_
"<tr><td width=""2%""></td>"&_
"<td width=""30%""><a href=""topic.asp?id="&rs("threadID")&""">"&rs("threadName")&"</a></td>"&_
"<td width=""5%"">"&rs("threadUser")&"</td>"&_
"<td width=""5%"">"&rs("threadAns")&"</td>"&_
"<td width=""15%"">"&rs("threadLastReply")&"</td></tr></table>"&_
Next
End IF
rs.close : set rs = nothing
Call DBClose()
If posts > Pz Then
For pagecounter = 1 to Pagecount
Response.write "<a href=""forum.asp?page="&pagecounter &"&id="&forum&""">"&pagecounter&"</a>"
Next
End IF
End IF
End IF
Call HTMLEnd()
%>
[/red]
Tackar ;)