473,396 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

AbsolutePosition Problem

Bob
Using ODBC to a SQL database I use the code;
Label1.Caption = record_rst.AbsolutePosition & " of " &
record_rst.RecordCount giving '4 of 256' for example. My problem, I am now
connecting to an MS Access database and it is returning ... '-1 of 256' any
suggestions
Nov 21 '05 #1
3 2788
It sounds like you are still using ADO Recordsets, rather than ADO .NET
DataTables and DataSets, right?

AbsolutePosition and RecordCount were never recommended for reliable results
in ADO since updates by others could throw those values off. If you are
recieving -1 for AbsolutePosition, it's probably because you are positioned
prior to the first record at the Beginning Of File (BOF) marker.

You should consider using ADO .NET and loading your data into DataTables &
DataSets. You could then use the index value of a given record in the
DataTable's Row collection.

-Scott

"Bob" <Bo*@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
Using ODBC to a SQL database I use the code;
Label1.Caption = record_rst.AbsolutePosition & " of " &
record_rst.RecordCount giving '4 of 256' for example. My problem, I am
now
connecting to an MS Access database and it is returning ... '-1 of 256'
any
suggestions

Nov 21 '05 #2
Its probably becuase you are not using client sided cursor. Make sure you
set the .cusorlocation of the recordset to 3 (adUseClient) prior to opening
to get an accurate recordcount.

Scott Emick
VB Programmer

"Scott M." <s-***@nospam.nospam> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
It sounds like you are still using ADO Recordsets, rather than ADO .NET
DataTables and DataSets, right?

AbsolutePosition and RecordCount were never recommended for reliable
results in ADO since updates by others could throw those values off. If
you are recieving -1 for AbsolutePosition, it's probably because you are
positioned prior to the first record at the Beginning Of File (BOF)
marker.

You should consider using ADO .NET and loading your data into DataTables &
DataSets. You could then use the index value of a given record in the
DataTable's Row collection.

-Scott

"Bob" <Bo*@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
Using ODBC to a SQL database I use the code;
Label1.Caption = record_rst.AbsolutePosition & " of " &
record_rst.RecordCount giving '4 of 256' for example. My problem, I am
now
connecting to an MS Access database and it is returning ... '-1 of 256'
any
suggestions


Nov 21 '05 #3
But, if you are going to do this, you might as well just use ADO .NET and
gain all the other benefits of it.
"Scott Emick" <se****@ham.fox-international.com> wrote in message
news:eJ**************@TK2MSFTNGP09.phx.gbl...
Its probably becuase you are not using client sided cursor. Make sure you
set the .cusorlocation of the recordset to 3 (adUseClient) prior to
opening to get an accurate recordcount.

Scott Emick
VB Programmer

"Scott M." <s-***@nospam.nospam> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
It sounds like you are still using ADO Recordsets, rather than ADO .NET
DataTables and DataSets, right?

AbsolutePosition and RecordCount were never recommended for reliable
results in ADO since updates by others could throw those values off. If
you are recieving -1 for AbsolutePosition, it's probably because you are
positioned prior to the first record at the Beginning Of File (BOF)
marker.

You should consider using ADO .NET and loading your data into DataTables
& DataSets. You could then use the index value of a given record in the
DataTable's Row collection.

-Scott

"Bob" <Bo*@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
Using ODBC to a SQL database I use the code;
Label1.Caption = record_rst.AbsolutePosition & " of " &
record_rst.RecordCount giving '4 of 256' for example. My problem, I am
now
connecting to an MS Access database and it is returning ... '-1 of 256'
any
suggestions



Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Hung Huynh | last post by:
Hi, I'm trying to use either one of these methods to position the cursor in a specific position inside a recordset, but neither one seems to work. For example, I have 10 records in my rsData...
1
by: Rob Bunocore | last post by:
I am have a continuous form as a subform which has a field called Status. For complicated reasons, I need users to only enter a status on the first record of the form no matter how many records...
9
by: superd052 | last post by:
So I'm having a little trouble with the Recordset.AbsolutePosition property, and similarly, the RecordsetClone.AbsolutePosition property in Access 2007. Here's what I'm trying to accomplish: I...
6
by: Trompomerson | last post by:
Hello guys, I am running the script below and am able to load my recordset and cycle through the values in the fields. However I want to use the .AbsolutePosition property to help place the data...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.