V
Vinnie Davidson
Hi!
I have a detail page that shows one spesific record based on the article ID.
I need to make a navigation on this detail page, with "previous article" and
"next article" links.
So, my question is how can I get the previous and next article ID based on
the article that is open??
I though about the MovePrevious and MoveNext methods, but it was no
success...
The SQL needs some parameters to get the correct records, like the example
below with "artID", "catID", "active", "custID".
My thoughs here is to open the record I'm in, move to previos record and get
the ID, move to next 2 times to get the next ID... Ofcouse this dont work
becouse of the artID in the SQL....?
<%
varID = Request.QueryString("id")
SQL = "SELECT artID, catID, active, custID from tblArticle where " &_
"((artID = '"&varID&"') AND (custID = '3') AND (active = '1'))"
set rsNavigate = server.CreateObject("adodb.recordset")
rsNavigate.Open SQL,connstring
rsNavigate.MovePrevious
dbPrev = rsNavigate.Fields("artID") 'Hoped this would give me the
previous ID..
rsNavigate.MoveNext
rsNavigate.MoveNext
dbNext = rsNavigate.Fields("artID") 'Hoped this would give me the next
ID...
rsNavigate.Close
set rsNavigate = nothing
%>
Can anyone please help me???
Vinnie
I have a detail page that shows one spesific record based on the article ID.
I need to make a navigation on this detail page, with "previous article" and
"next article" links.
So, my question is how can I get the previous and next article ID based on
the article that is open??
I though about the MovePrevious and MoveNext methods, but it was no
success...
The SQL needs some parameters to get the correct records, like the example
below with "artID", "catID", "active", "custID".
My thoughs here is to open the record I'm in, move to previos record and get
the ID, move to next 2 times to get the next ID... Ofcouse this dont work
becouse of the artID in the SQL....?
<%
varID = Request.QueryString("id")
SQL = "SELECT artID, catID, active, custID from tblArticle where " &_
"((artID = '"&varID&"') AND (custID = '3') AND (active = '1'))"
set rsNavigate = server.CreateObject("adodb.recordset")
rsNavigate.Open SQL,connstring
rsNavigate.MovePrevious
dbPrev = rsNavigate.Fields("artID") 'Hoped this would give me the
previous ID..
rsNavigate.MoveNext
rsNavigate.MoveNext
dbNext = rsNavigate.Fields("artID") 'Hoped this would give me the next
ID...
rsNavigate.Close
set rsNavigate = nothing
%>
Can anyone please help me???
Vinnie