Strange Values IN AbsolutePosition After MOVELAST in RDO As Record Increases

Hello Experts,

This is really very strange to me.
In my application, I have used many times in may modules something like as below for doing different different operations for specfifc needs.

Set RDORECORDSET = Nothing
Set RDORECORDSET = CONNECTION.OpenResultset("QUERY", rdOpenDynamic, rdConcurRowVer)
.....
.....

RDORECORDSET.MoveLast
If (rdorspo2.AbsolutePosition = -1) Then   //no records
..... do something
else                                      // some records
..... do some other thing
endif.

It was working fine. But recently,
After my client complaints, I run the application based on his Database, and I saw that ::

After The NUMBER of records in A table increases beyond a particular Limit,

RDORECORDSET.MoveLast
If (rdorspo2.AbsolutePosition = -1) Then

THIS IS NO WORKING. The Pointer Offcourse is at LAST Record ONLY becuase I printed the record, but absoluteposition is coming onwards as -1 only, though it should be last record number.
This is happening in all tables after NUMBER of records crosses a particluar LIMIT, YES different limits in Different Tables depending upon the Fileds/Fields Width of different tables.

Please explin me why this AbsoultePostion is giving worng values as -1 after movelast, as Records increases a LIMIT.

Best Regards
Austin


austin123Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:
Checking if you have records in the recordset should be:

If (rdorspo2.Eof AND rdorspo2.bof) Then   //no records
..... do something
else                                      // some records
..... do some other thing
endif.

I haven't seen the other issue, but I guess that is has to do with Existence of primary key in the table...

CHeers
riaz9Commented:
Try using client-side cursors

cnConnection.CursorLocation = adUseClient
Anthony PerkinsCommented:
riaz9,

This question has to do with RDO not ADO: No CursorLocation property in RDO.

Anthony
austin123Author Commented:
Thanks all,

The point is not to use the other way as suggested above, but the problem is absolueposition is not working and giving as -1 on movelast, as number of record increases a particular limit, say after 100 records, before that limit of records absoluteposition was working fine and giving last record number.
As for other approach I could have also used,

RDORECORDSET.movefirst
If not (rdorspo2.AbsolutePosition >0 ) Then   //no records
..... do something
else                                      // some records
..... do some other thing
endif.

Which always works fine and no problem as number of records increases. But the application was running on the client side from the last 1 month, doing some change and that too in many many modules, occuring many times is a bit troublesome and risky.
So I hope if this could only be solved, becuase it's not logical to give -1 on movelast for RDO absoluteposition.

Best Regards
Austin


Anthony PerkinsCommented:
Let me make sure I understand:
First of all you are using an API (RDO, that is) that not even Microsoft supports any longer, as it has been replaced over four years ago by ADO.

Secondly, you have witnessed a scenario where you code does not account for the outcome.  Experts here have suggested a workaround, which you have rejected.

Having said that, let me suggest you try changing the CursorDriver property of the Connection object to either rdUseClientBatch or rdUseODBC.  I have not tested this. If your backend is SQL Server then the default is rdUseServer.

Anthony

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.