<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>RE: [AccessD] .Recordcount returns -1? <SOLVED></TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>Why do you think they were named "cursers?" <g></FONT>
<BR><FONT SIZE=2>Jim</FONT>
</P>
<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Sad Der [<A HREF="mailto:accessd666@yahoo.com">mailto:accessd666@yahoo.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Friday, July 11, 2003 4:55 AM</FONT>
<BR><FONT SIZE=2>To: Access Developers discussion and problem solving</FONT>
<BR><FONT SIZE=2>Subject: RE: [AccessD] .Recordcount returns -1? <SOLVED></FONT>
</P>
<BR>
<P><FONT SIZE=2>AHHRG, thnx.</FONT>
</P>
<P><FONT SIZE=2>So close yet so far away...</FONT>
</P>
<BR>
<P><FONT SIZE=2>--- Bryan Carbonnell <Bryan_Carbonnell@cbc.ca> wrote:</FONT>
<BR><FONT SIZE=2>> adOpenDynamic cursor doesn't either, but</FONT>
<BR><FONT SIZE=2>> adOpenStatic does.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> I just fought with that this week.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Bryan Carbonnell</FONT>
<BR><FONT SIZE=2>> bryan_carbonnell@cbc.ca</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> >>> Jdemarco@hshhp.org 10-Jul-03 9:51:03 AM >>></FONT>
<BR><FONT SIZE=2>> It also depends on the type of cursor. </FONT>
<BR><FONT SIZE=2>> adOpenForwardOnly won't return a record count while</FONT>
<BR><FONT SIZE=2>> adOpenKeyset will.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> HTH,</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Jim DeMarco</FONT>
<BR><FONT SIZE=2>> Director of Product Development</FONT>
<BR><FONT SIZE=2>> HealthSource/Hudson Health Plan</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> -----Original Message-----</FONT>
<BR><FONT SIZE=2>> From: Mark H [<A HREF="mailto:Lists@theopg.com">mailto:Lists@theopg.com</A>] </FONT>
<BR><FONT SIZE=2>> Sent: Thursday, July 10, 2003 9:31 AM</FONT>
<BR><FONT SIZE=2>> To: 'Access Developers discussion and problem</FONT>
<BR><FONT SIZE=2>> solving'</FONT>
<BR><FONT SIZE=2>> Subject: RE: [AccessD] .Recordcount returns -1?</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Ado returns -1 if it can't get the recordcount, or</FONT>
<BR><FONT SIZE=2>> the provider or</FONT>
<BR><FONT SIZE=2>> cursor don't support recordcount. A real pain in the</FONT>
<BR><FONT SIZE=2>> back side...</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Mark</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> -----Original Message-----</FONT>
<BR><FONT SIZE=2>> From: accessd-bounces@databaseadvisors.com </FONT>
<BR><FONT SIZE=2>> [<A HREF="mailto:accessd-bounces@databaseadvisors.com">mailto:accessd-bounces@databaseadvisors.com</A>] On</FONT>
<BR><FONT SIZE=2>> Behalf Of Sad Der</FONT>
<BR><FONT SIZE=2>> Sent: 10 July 2003 14:13</FONT>
<BR><FONT SIZE=2>> To: Acces User Group</FONT>
<BR><FONT SIZE=2>> Subject: [AccessD] .Recordcount returns -1?</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Hi,</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> those damn 2 years that i've been Oracle-ing...</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> I use a ADODB recordset in my A2K application. With</FONT>
<BR><FONT SIZE=2>> this recordset I get all date from a table. The</FONT>
<BR><FONT SIZE=2>> table</FONT>
<BR><FONT SIZE=2>> has 1 record.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> When I use the code below rst.Recordcount returns</FONT>
<BR><FONT SIZE=2>> -1.</FONT>
<BR><FONT SIZE=2>> Why is that? MsgBox .Fields(0) returns 01/07/2003 So</FONT>
<BR><FONT SIZE=2>> it should pick it up.</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> What am i missing?</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> thnx in advance,</FONT>
<BR><FONT SIZE=2>> Sander</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Dim conn As ADODB.Connection 'db</FONT>
<BR><FONT SIZE=2>> connection</FONT>
<BR><FONT SIZE=2>> Dim rst As ADODB.Recordset 'recordset</FONT>
<BR><FONT SIZE=2>> returned by the query</FONT>
<BR><FONT SIZE=2>> Dim strSQL As String</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> Set conn = CurrentProject.Connection</FONT>
<BR><FONT SIZE=2>> Set rst = New ADODB.Recordset</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> strSQL = "SELECT date FROM tblActivity" </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> With rst</FONT>
<BR><FONT SIZE=2>> .ActiveConnection = conn</FONT>
<BR><FONT SIZE=2>> .Source = strSQL</FONT>
<BR><FONT SIZE=2>> .CursorType = adOpenDynamic</FONT>
<BR><FONT SIZE=2>> .Open</FONT>
<BR><FONT SIZE=2>> .MoveLast</FONT>
<BR><FONT SIZE=2>> .MoveFirst</FONT>
<BR><FONT SIZE=2>> MsgBox .Fields(0)</FONT>
<BR><FONT SIZE=2>> End With</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> MsgBox rst.RecordCount</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> _______________________________________________</FONT>
<BR><FONT SIZE=2>> AccessD mailing list</FONT>
<BR><FONT SIZE=2>> AccessD@databaseadvisors.com</FONT>
<BR><FONT SIZE=2>> <A HREF="http://databaseadvisors.com/mailman/listinfo/accessd" TARGET="_blank">http://databaseadvisors.com/mailman/listinfo/accessd</A></FONT>
<BR><FONT SIZE=2>> Website: <A HREF="http://www.databaseadvisors.com" TARGET="_blank">http://www.databaseadvisors.com</A></FONT>
</P>
<BR>
<P><FONT SIZE=2>__________________________________</FONT>
<BR><FONT SIZE=2>Do you Yahoo!?</FONT>
<BR><FONT SIZE=2>SBC Yahoo! DSL - Now only $29.95 per month!</FONT>
<BR><FONT SIZE=2><A HREF="http://sbc.yahoo.com" TARGET="_blank">http://sbc.yahoo.com</A></FONT>
<BR><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>AccessD mailing list</FONT>
<BR><FONT SIZE=2>AccessD@databaseadvisors.com</FONT>
<BR><FONT SIZE=2><A HREF="http://databaseadvisors.com/mailman/listinfo/accessd" TARGET="_blank">http://databaseadvisors.com/mailman/listinfo/accessd</A></FONT>
<BR><FONT SIZE=2>Website: <A HREF="http://www.databaseadvisors.com" TARGET="_blank">http://www.databaseadvisors.com</A></FONT>
</P>
</BODY>
</HTML>