|
-
Jun 27th, 2000, 06:16 PM
#1
Thread Starter
Addicted Member
Hi,
I sent in an issue a couple of days ago regarding the fact that WHATEVER cursor type I used in a parameterised command query, I kept getting a record count = -1. I know this is indicative of an incorrect cursor type. I have tried ALL the possible cursort types and still get the same result for record count.
As a side issue, I tried the same this i.e. returning records from SQL Server using a DE, and the recordcount works fine. This setup is exactly the same as my parameterised queries apart from using a DE, i.e. both implement classes to return an ADODB.Recordset.
This is very frustrating. Has anyone came across this before or is able to take a bit of time to try to recreate? I will be more than happy to provide source.
Previous email below
Hi,
I had a problem last week with a component returning a recordset to a Vis InterDev page, and not having all the recordset properties exposed. I emailed and got a response pointing to the cursortype of the returned recordset ( thanks clunietp ). However when I change the cursortype in the component ( to adopendynamic or anything else ) it fails to return the correct recordcount ( returns -1 pointing STILL to cursortype). When I check the cursot type it is set to 0, which is correct.
Is the code below the most effective method of setting the cursor type? I cannot use the recordset.open syntax as this is a parameterized command query.
Can somebody point me in the right direction?
Set lrs_getOpenCalls = New ADODB.Recordset
lrs_getOpenCalls.CursorType = adOpenDynamic
Set lrs_getOpenCalls = comm_getOpenCalls.Execute
MsgBox lrs_getOpenCalls.RecordCount
Set get_Open_Calls = lrs_getOpenCalls
Thanks in advance.
Lenin
-
Jun 27th, 2000, 06:59 PM
#2
Hyperactive Member
i **Think** it also has to do with the type of locking you use, eg: -
optimistic locking seems to give a recordcount with dynamic and static cursors, but not with forward only...
-
Jun 27th, 2000, 07:06 PM
#3
Thread Starter
Addicted Member
JimBob,
tried all locking types, same result. Thanks for the input though.
Lenin
-
Jun 28th, 2000, 12:44 PM
#4
Guru
your database is SQL server? what version?
try these properties, I KNOW these work for me (SQL 7)
cursorlocation = Client
cursortype = static
these ALWAYS work when retrieving the recordcount from SQL Server (and MS Access too)....
if not, lets see your code...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|