Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Recordcount = -1, recordset does not support


Message #1 by "Chiam Suet YIn Joyce" <joyce.chiam.jc@b...> on Wed, 8 Jan 2003 06:54:40
Hi,
I'm trying to do a pagin for the record that is retrieve from a visual 
foxpro database.

when i refresh the page, i getting the following error msg.

Page 1 of -1 -1 members. 
ADODB.Recordset error '800a0cb3' 
Current Recordset does not support bookmarks. This may be a limitation of 
the provider or of the selected cursortype. 
 
how can i solve the error.

following is the code.

thank you

<%Option Explicit%>
<!-- #INCLUDE FILE = "includes/header.asp" -->
<!-- #INCLUDE FILE = "js/login_check.js" -->
</head>
<body BGCOLOR="#FFFFFF" TEXT="#000000" LEFTMARGIN="0" TOPMARGIN="0" 
MARGINWIDTH="0" MARGINHEIGHT="0">
<!-- #INCLUDE FILE = "includes/top_banner.asp" -->
<% Set Rs = strConn.Execute ("SELECT * FROM Country") %>
<table BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="1000">
<tr>
<td VALIGN="TOP" ALIGN="left" WIDTH="170">
<!-- #INCLUDE FILE = "includes/side_navigation.asp"-->
</td>
	
<td VALIGN="top" ALIGN="left">
<!-- TABLE TO HOLD THE SUMMARY BODY -->		
<table CELLSPACING="0" CELLPADDING="0" WIDTH="600" ALIGN="left" BORDER="0">
<tr><td height="1"></td></tr>
<tr><td><font class="txt_b">Sales Overview by Customer</font></td></tr>
<tr>
<td VALIGN="top" ALIGN="left">
<Table cellpadding="0" cellspacing="1" border="0" width="790">
<tr><td>&nbsp;</td></tr>
<tr>
<td><% Set Rs = StrConn.Execute ("Select Distinct cbu From saleov") %>
<select id=select2 name=select2>
<option value="">BU</option>
<% Do while not RS.eof %>
<option value="<%=trim(RS("cbu"))%>"><%=trim(RS("cbu"))%></option>
<%
RS.movenext
Loop
Rs.close
%></select></td>

<td><% Set Rs = StrConn.Execute ("Select Distinct Pg2 From saleov") %>
<select>
<option value="">VHP</option>
<% Do while not RS.eof %>
<option value="<%=trim(RS("Pg2"))%>"><%=trim(RS("Pg2"))%></option>
<%
RS.movenext
Loop
Rs.close
%></select></td>

<td><% Set Rs = StrConn.Execute ("Select Distinct cusnm From saleov") %>
<select id=select1 name=select1>
<option value="">CUSTOMER</option>
<% Do while not RS.eof %>
<option value="<%=RS("cusnm")%>"><%=RS("cusnm")%></option>
<%
RS.movenext
Loop
Rs.close
%></select>
</td>

<td><% Set Rs = StrConn.Execute ("Select Distinct itdsc From saleov") %>
<select id=select1 name=select1>
<option value="">PRODUCT</option>
<% Do while not RS.eof %>
<option value="<%=RS("itdsc")%>"><%=RS("itdsc")%></option>
<%
RS.movenext
Loop
Rs.close
%></select>
</td>
</tr>
</table>

<Table cellpadding="2" cellspacing="1" border="0" width="790">
<tr><td>&nbsp;</td></tr>
<tr>
<td width="280"><font class="txt_b">CUSTOMER</font></td>
<td><font class="txt_b">PRODUCT</font></td>
<td><font class="txt_b">UM</font></td>
<td><font class="txt_b">QTY</font></td>
<td><font class="txt_b">SALES VALUE</font></td>
<td><font class="txt_b">COGS</font></td>
<td><font class="txt_b">SALES MARGIN</font></td><!-- (Sales Value - 
COGs)/Sales Value -->
</tr>	
<% 
Dim strSQL
'Set Rs1 = StrConn.Execute ("Select *, sum(salqt) as sqt, sum(salam) as 
sam, sum(salcs) as scs, sum(salmar) as smar From saleov Group by cusnm")
set RS1 = createobject("adodb.recordset")
strSQL = "Select *, sum(salqt) as sqt, sum(salam) as sam, sum(salcs) as 
scs, sum(salmar) as smar From saleov Group by cusnm"
Set RS1 = strConn.Execute(strSQL)

call PagingMain() 
%> 

<table width="100%" border="0">
<tr>
<td width="50%" align="left">Page <%=intPagenum%> of <%=rs1.PageCount%
></td>
<td width="50%" align="right"><%=rs1.RecordCount%> members.</td>
</tr>
</table> 
<table width="100%" border="1">
<% 
rs1.AbsolutePage = intPageNum
For intCount = 1 To rs1.PageSize
%>
<tr>
<td width="280"><font class="txt">+ <%=RS1("cusnm")%></font></td>
<td><font class="txt">-</font></td>
<td><font class="txt">-</font></td>
<td><font class="txt"><%=trim(RS1("sqt"))%></font></td>
<td><font class="txt"><%=trim(Rs1("sam"))%></font></td>
<td><font class="txt"><%=trim(RS1("scs"))%></font></td>
<td><font class="txt"><%=trim(RS1("salmar"))%></font></td>
</tr>
<%
rs1.MoveNext
If rs1.EOF Then Exit For
Next
%>
</table> 
<br>
<center><%call DisplayNavigation()%></center>
<!--#include file="includes/page.asp"-->
<%
rs1.Close
Set rs1 = Nothing
%> 					
</td>
</tr>
</table>
</td>	
</tr>	
</table>

<!-- #INCLUDE file = "includes/footer.asp" -->
Message #2 by "Nataraj" <nattyboy@j...> on Wed, 8 Jan 2003 14:39:05 +0530
Hi,

You have Used the Code like below
Set RS1 = strConn.Execute(strSQL)

Modify the Code as below

RS1.Open strSQL, strConn, 3, 1

then you will not get the Record count as -1

- Nataraj



----- Original Message -----
From: "Chiam Suet YIn Joyce" <joyce.chiam.jc@b...>
To: "ASP Databases" <asp_databases@p...>
Sent: Wednesday, January 08, 2003 6:54 AM
Subject: [asp_databases] Recordcount = -1, recordset does not support


> Hi,
> I'm trying to do a pagin for the record that is retrieve from a visual
> foxpro database.
>
> when i refresh the page, i getting the following error msg.
>
> Page 1 of -1 -1 members.
> ADODB.Recordset error '800a0cb3'
> Current Recordset does not support bookmarks. This may be a limitation of
> the provider or of the selected cursortype.
>
> how can i solve the error.
>
> following is the code.
>
> thank you
>
> <%Option Explicit%>
> <!-- #INCLUDE FILE = "includes/header.asp" -->
> <!-- #INCLUDE FILE = "js/login_check.js" -->
> </head>
> <body BGCOLOR="#FFFFFF" TEXT="#000000" LEFTMARGIN="0" TOPMARGIN="0"
> MARGINWIDTH="0" MARGINHEIGHT="0">
> <!-- #INCLUDE FILE = "includes/top_banner.asp" -->
> <% Set Rs = strConn.Execute ("SELECT * FROM Country") %>
> <table BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="1000">
> <tr>
> <td VALIGN="TOP" ALIGN="left" WIDTH="170">
> <!-- #INCLUDE FILE = "includes/side_navigation.asp"-->
> </td>
>
> <td VALIGN="top" ALIGN="left">
> <!-- TABLE TO HOLD THE SUMMARY BODY -->
> <table CELLSPACING="0" CELLPADDING="0" WIDTH="600" ALIGN="left"
BORDER="0">
> <tr><td height="1"></td></tr>
> <tr><td><font class="txt_b">Sales Overview by Customer</font></td></tr>
> <tr>
> <td VALIGN="top" ALIGN="left">
> <Table cellpadding="0" cellspacing="1" border="0" width="790">
> <tr><td>&nbsp;</td></tr>
> <tr>
> <td><% Set Rs = StrConn.Execute ("Select Distinct cbu From saleov") %>
> <select id=select2 name=select2>
> <option value="">BU</option>
> <% Do while not RS.eof %>
> <option value="<%=trim(RS("cbu"))%>"><%=trim(RS("cbu"))%></option>
> <%
> RS.movenext
> Loop
> Rs.close
> %></select></td>
>
> <td><% Set Rs = StrConn.Execute ("Select Distinct Pg2 From saleov") %>
> <select>
> <option value="">VHP</option>
> <% Do while not RS.eof %>
> <option value="<%=trim(RS("Pg2"))%>"><%=trim(RS("Pg2"))%></option>
> <%
> RS.movenext
> Loop
> Rs.close
> %></select></td>
>
> <td><% Set Rs = StrConn.Execute ("Select Distinct cusnm From saleov") %>
> <select id=select1 name=select1>
> <option value="">CUSTOMER</option>
> <% Do while not RS.eof %>
> <option value="<%=RS("cusnm")%>"><%=RS("cusnm")%></option>
> <%
> RS.movenext
> Loop
> Rs.close
> %></select>
> </td>
>
> <td><% Set Rs = StrConn.Execute ("Select Distinct itdsc From saleov") %>
> <select id=select1 name=select1>
> <option value="">PRODUCT</option>
> <% Do while not RS.eof %>
> <option value="<%=RS("itdsc")%>"><%=RS("itdsc")%></option>
> <%
> RS.movenext
> Loop
> Rs.close
> %></select>
> </td>
> </tr>
> </table>
>
> <Table cellpadding="2" cellspacing="1" border="0" width="790">
> <tr><td>&nbsp;</td></tr>
> <tr>
> <td width="280"><font class="txt_b">CUSTOMER</font></td>
> <td><font class="txt_b">PRODUCT</font></td>
> <td><font class="txt_b">UM</font></td>
> <td><font class="txt_b">QTY</font></td>
> <td><font class="txt_b">SALES VALUE</font></td>
> <td><font class="txt_b">COGS</font></td>
> <td><font class="txt_b">SALES MARGIN</font></td><!-- (Sales Value -
> COGs)/Sales Value -->
> </tr>
> <%
> Dim strSQL
> 'Set Rs1 = StrConn.Execute ("Select *, sum(salqt) as sqt, sum(salam) as
> sam, sum(salcs) as scs, sum(salmar) as smar From saleov Group by cusnm")
> set RS1 = createobject("adodb.recordset")
> strSQL = "Select *, sum(salqt) as sqt, sum(salam) as sam, sum(salcs) as
> scs, sum(salmar) as smar From saleov Group by cusnm"
> Set RS1 = strConn.Execute(strSQL)
>
> call PagingMain()
> %>
>
> <table width="100%" border="0">
> <tr>
> <td width="50%" align="left">Page <%=intPagenum%> of <%=rs1.PageCount%
> ></td>
> <td width="50%" align="right"><%=rs1.RecordCount%> members.</td>
> </tr>
> </table>
> <table width="100%" border="1">
> <%
> rs1.AbsolutePage = intPageNum
> For intCount = 1 To rs1.PageSize
> %>
> <tr>
> <td width="280"><font class="txt">+ <%=RS1("cusnm")%></font></td>
> <td><font class="txt">-</font></td>
> <td><font class="txt">-</font></td>
> <td><font class="txt"><%=trim(RS1("sqt"))%></font></td>
> <td><font class="txt"><%=trim(Rs1("sam"))%></font></td>
> <td><font class="txt"><%=trim(RS1("scs"))%></font></td>
> <td><font class="txt"><%=trim(RS1("salmar"))%></font></td>
> </tr>
> <%
> rs1.MoveNext
> If rs1.EOF Then Exit For
> Next
> %>
> </table>
> <br>
> <center><%call DisplayNavigation()%></center>
> <!--#include file="includes/page.asp"-->
> <%
> rs1.Close
> Set rs1 = Nothing
> %>
> </td>
> </tr>
> </table>
> </td>
> </tr>
> </table>
>
> <!-- #INCLUDE file = "includes/footer.asp" -->

Message #3 by "Ron Williams" <ronwilliams32@c...> on Thu, 9 Jan 2003 21:22:04
I dont have your code here, but i can tell you, that certain daya 
providers dont support certain cursor types and certain cursor types wont 
work unless the provider supports bookmarks.  i used to come across that 
issue all the time with Access 97.  i dont see the 'on error resume next', 
did the error give you a line number?


> Hi,
I> 'm trying to do a pagin for the record that is retrieve from a visual 
f> oxpro database.

> when i refresh the page, i getting the following error msg.

> Page 1 of -1 -1 members. 
A> DODB.Recordset error '800a0cb3' 
C> urrent Recordset does not support bookmarks. This may be a limitation 
of 
t> he provider or of the selected cursortype. 
 > 
h> ow can i solve the error.

> following is the code.

> thank you

> <%Option Explicit%>
<> !-- #INCLUDE FILE = "includes/header.asp" -->
<> !-- #INCLUDE FILE = "js/login_check.js" -->
<> /head>
<> body BGCOLOR="#FFFFFF" TEXT="#000000" LEFTMARGIN="0" TOPMARGIN="0" 
M> ARGINWIDTH="0" MARGINHEIGHT="0">
<> !-- #INCLUDE FILE = "includes/top_banner.asp" -->
<> % Set Rs = strConn.Execute ("SELECT * FROM Country") %>
<> table BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="1000">
<> tr>
<> td VALIGN="TOP" ALIGN="left" WIDTH="170">
<> !-- #INCLUDE FILE = "includes/side_navigation.asp"-->
<> /td>
	> 
<> td VALIGN="top" ALIGN="left">
<> !-- TABLE TO HOLD THE SUMMARY BODY -->		
<> table CELLSPACING="0" CELLPADDING="0" WIDTH="600" ALIGN="left" 
BORDER="0">
<> tr><td height="1"></td></tr>
<> tr><td><font class="txt_b">Sales Overview by Customer</font></td></tr>
<> tr>
<> td VALIGN="top" ALIGN="left">
<> Table cellpadding="0" cellspacing="1" border="0" width="790">
<> tr><td>&nbsp;</td></tr>
<> tr>
<> td><% Set Rs = StrConn.Execute ("Select Distinct cbu From saleov") %>
<> select id=select2 name=select2>
<> option value="">BU</option>
<> % Do while not RS.eof %>
<> option value="<%=trim(RS("cbu"))%>"><%=trim(RS("cbu"))%></option>
<> %
R> S.movenext
L> oop
R> s.close
%> ></select></td>

> <td><% Set Rs = StrConn.Execute ("Select Distinct Pg2 From saleov") %>
<> select>
<> option value="">VHP</option>
<> % Do while not RS.eof %>
<> option value="<%=trim(RS("Pg2"))%>"><%=trim(RS("Pg2"))%></option>
<> %
R> S.movenext
L> oop
R> s.close
%> ></select></td>

> <td><% Set Rs = StrConn.Execute ("Select Distinct cusnm From saleov") %>
<> select id=select1 name=select1>
<> option value="">CUSTOMER</option>
<> % Do while not RS.eof %>
<> option value="<%=RS("cusnm")%>"><%=RS("cusnm")%></option>
<> %
R> S.movenext
L> oop
R> s.close
%> ></select>
<> /td>

> <td><% Set Rs = StrConn.Execute ("Select Distinct itdsc From saleov") %>
<> select id=select1 name=select1>
<> option value="">PRODUCT</option>
<> % Do while not RS.eof %>
<> option value="<%=RS("itdsc")%>"><%=RS("itdsc")%></option>
<> %
R> S.movenext
L> oop
R> s.close
%> ></select>
<> /td>
<> /tr>
<> /table>

> <Table cellpadding="2" cellspacing="1" border="0" width="790">
<> tr><td>&nbsp;</td></tr>
<> tr>
<> td width="280"><font class="txt_b">CUSTOMER</font></td>
<> td><font class="txt_b">PRODUCT</font></td>
<> td><font class="txt_b">UM</font></td>
<> td><font class="txt_b">QTY</font></td>
<> td><font class="txt_b">SALES VALUE</font></td>
<> td><font class="txt_b">COGS</font></td>
<> td><font class="txt_b">SALES MARGIN</font></td><!-- (Sales Value - 
C> OGs)/Sales Value -->
<> /tr>	
<> % 
D> im strSQL
'> Set Rs1 = StrConn.Execute ("Select *, sum(salqt) as sqt, sum(salam) as 
s> am, sum(salcs) as scs, sum(salmar) as smar From saleov Group by cusnm")
s> et RS1 = createobject("adodb.recordset")
s> trSQL = "Select *, sum(salqt) as sqt, sum(salam) as sam, sum(salcs) as 
s> cs, sum(salmar) as smar From saleov Group by cusnm"
S> et RS1 = strConn.Execute(strSQL)

> call PagingMain() 
%> > 

> <table width="100%" border="0">
<> tr>
<> td width="50%" align="left">Page <%=intPagenum%> of <%=rs1.PageCount%
>> </td>
<> td width="50%" align="right"><%=rs1.RecordCount%> members.</td>
<> /tr>
<> /table> 
<> table width="100%" border="1">
<> % 
r> s1.AbsolutePage = intPageNum
F> or intCount = 1 To rs1.PageSize
%> >
<> tr>
<> td width="280"><font class="txt">+ <%=RS1("cusnm")%></font></td>
<> td><font class="txt">-</font></td>
<> td><font class="txt">-</font></td>
<> td><font class="txt"><%=trim(RS1("sqt"))%></font></td>
<> td><font class="txt"><%=trim(Rs1("sam"))%></font></td>
<> td><font class="txt"><%=trim(RS1("scs"))%></font></td>
<> td><font class="txt"><%=trim(RS1("salmar"))%></font></td>
<> /tr>
<> %
r> s1.MoveNext
I> f rs1.EOF Then Exit For
N> ext
%> >
<> /table> 
<> br>
<> center><%call DisplayNavigation()%></center>
<> !--#include file="includes/page.asp"-->
<> %
r> s1.Close
S> et rs1 = Nothing
%> > 					
<> /td>
<> /tr>
<> /table>
<> /td>	
<> /tr>	
<> /table>

> <!-- #INCLUDE file = "includes/footer.asp" -->

  Return to Index