ADO and recordCount

  • When I use OLE DB to connect to the SQL Server DB , using openkeyset cursor I open a RecordSet. If there are records the RecordCount Function returns the right count. If there are no rows it returns -1 instead of 0. Why ?

    When I used ODBC before it returned 0. Is there any special connection setting I need to do ?

  • what application are you connecting through?

  • Visual Basic, and connecting throught ADO

  • what type of cursor are you using to open the recordset. ReadOnly, ForwardOnly?

    When using the above cursor type, it usually returns -1. If you were to use for example: static, optimistic cursor does it return 0?

  • Cursor is OpenKeyset

  • try using a different cursor type and see what happens?

  • Hi,

    When I am using Open recordset statement with VB and ADO like following:

    rsRecords.Open "select * from " & table_name, con, adOpenStatic, adLockOptimistic, adCmdText

    I am getting an error message :

    [Microsoft][ODBC SQL Server Driver][SQL Server]Cursor open failed because the size of the keyset row exceeded maximum allowed

    Why its happening?????????

    Thanx in advance

  • Not sure...let me get back with an answer

  • A few questions for you...

    Are you using a client or server side cursor? Does the table contain a text datatype column?

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply