crisedefoie
Programmer
Hello!
I have a reccurent problem :
I have a program in VB6 using SQL Server Database. When I try to open a recordset and to know the recordcount, it always return -1!!!!
I saw in other topics many advices about cursor type etc..
but ... it doesn't work neither.
There is a piece of my code :
With rcstMesurage
.Open "(SELECT BillID, BillDate FROM Bills1) UNION
(SELECT BillID, BillDate FROM Bills2)",
MyConnection, adOpenKeyset, adLockOptimistic
If Not .EOF Then
.MoveLast
ldBillCount = .RecordCount
.MoveFirst
end if
'initializing progress bar (....)
while not .EOF
(.....)
.movenext
wend
.close
End with
The recordcount always return -1 but .EOF = False !!!
Is there someone who knows how to resolve this, please?
I tried many things but it didn't work
Thanks
I have a reccurent problem :
I have a program in VB6 using SQL Server Database. When I try to open a recordset and to know the recordcount, it always return -1!!!!
I saw in other topics many advices about cursor type etc..
but ... it doesn't work neither.
There is a piece of my code :
With rcstMesurage
.Open "(SELECT BillID, BillDate FROM Bills1) UNION
(SELECT BillID, BillDate FROM Bills2)",
MyConnection, adOpenKeyset, adLockOptimistic
If Not .EOF Then
.MoveLast
ldBillCount = .RecordCount
.MoveFirst
end if
'initializing progress bar (....)
while not .EOF
(.....)
.movenext
wend
.close
End with
The recordcount always return -1 but .EOF = False !!!
Is there someone who knows how to resolve this, please?
I tried many things but it didn't work
Thanks