By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,481 Members | 979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,481 IT Pros & Developers. It's quick & easy.

AbsolutePosition Problem

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.