venmarces
asked on
VB6 Recordset is empty when records exist in my View because of Group By
Hi
I'm programming with VBA for Excel, and I have a SELECT instruction that returns -1 RecordCount.
Here is my Slect Instruction :
RsPortes.Open "Select SONumber, NumSection, Qty, UniteMesure, ItemNumber, ItemName, DFTPICKINGLISTOPR FROM V_Portes WHERE V_Portes.SONumber='" & NumJob & "'", MaConnectionAxaptaData, adOpenDynamic, adLockOptimistic
The V_Portes is an SqlServer2005 view that is build with a Group By, it is working fine and getting the right results.
How can I get my recordset lines within VBA Excel code ?
Thanks
I'm programming with VBA for Excel, and I have a SELECT instruction that returns -1 RecordCount.
Here is my Slect Instruction :
RsPortes.Open "Select SONumber, NumSection, Qty, UniteMesure, ItemNumber, ItemName, DFTPICKINGLISTOPR FROM V_Portes WHERE V_Portes.SONumber='" & NumJob & "'", MaConnectionAxaptaData, adOpenDynamic, adLockOptimistic
The V_Portes is an SqlServer2005 view that is build with a Group By, it is working fine and getting the right results.
How can I get my recordset lines within VBA Excel code ?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And in case you did not get the message: The RecordCount property should not be used.
ASKER
When I needed to get the RcordCount value of my Cursor I changed for adOpenStatic, adLockReadOnly and I was able to get the right value
Thanks for everybody
Thanks for everybody
that happens because you open on ServerSide instead of ClientSide cursor location, usually.
anyhow, do you really need the recordcount itself, or just if there are records or not => use bof and eof instead.