CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: Methods Support

  1. #1
    Join Date
    Aug 2001
    Location
    PA
    Posts
    150

    Methods Support

    Hello all,

    Here is my problem:

    The MSDN help line states that:
    (For example, the OLE DB Provider for Microsoft Jet supports Seek and Index.)
    Microsoft.Jet.OLEDB.4.0




    If rs_Table.Supports(adIndex) And rs_Table.Supports(adSeek) Then
    end if

    But when I try to use the support method to verify that, the return value is false. Thus, I can not use the methods Index and Seek.
    Could anyone help please.

    Thanks
    Hisham
    Thank You, Hisham

  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Methods Support

    This could be because of the selected cursortype or locktype. You must use a recordsource that enables you to move back and forth through your recordset. Try opening the recordset using the adKeyset or adDynamic cursor type.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Aug 2001
    Location
    PA
    Posts
    150

    Re: Methods Support

    Hi,

    Here is my code:
    rs_Table.Open Table_Name, ConnA.Get_conn, adOpenDynamic, adLockOptimistic, adCmdTableDirect


    But when I use

    If rs_Table.Supports(adIndex) And rs_Table.Supports(adIndex) Then

    End If

    It always evaluate false meaning it is not supporting the two methods.

    Any Ideas?



    Thanks
    Hisham
    Thank You, Hisham

  4. #4
    Join Date
    Dec 1999
    Location
    Greece
    Posts
    75

    Re: Methods Support

    the seek operation is only supported by server-based cursors(CursorLocation=adUseServer).This is because it uses the cursor service and indexes on the provider rather than the facilities of ADO.



  5. #5
    Join Date
    Aug 2001
    Location
    PA
    Posts
    150

    Re: Methods Support

    Thank you very much.

    Thanks
    Hisham
    Thank You, Hisham

  6. #6
    Join Date
    Aug 2001
    Location
    PA
    Posts
    150

    Re: Methods Support

    Hi,

    Initially I thought its working but it is not. Even though I have used the server side location but it is not working. I am executing on Access 97 database. Here is my code:

    rs_Table.CursorLocation = adUseServer

    rs_Table.Open Table_Name, ConnA.Get_conn, adOpenKeyset, adLockReadOnly, adCmdTableDirect

    ---------------------> it is not passing through
    If rs_Table.Supports(adIndex) Then
    MsgBox "HI"
    End If

    Thanks
    Hisham
    Thank You, Hisham

  7. #7
    Join Date
    Dec 1999
    Location
    Greece
    Posts
    75

    Re: Methods Support

    Use the property cursorlocation on the connection
    property or both recordset and connection objects
    General OLEDB Provider and ODBC does not support some properties of ADO objects such as recordcount.
    In my opinion you should connect using ODBC driver
    or I think that there is a new version of OLEDB
    provider that may support these properties.See microsoft site.



  8. #8
    Join Date
    Aug 2001
    Location
    PA
    Posts
    150

    Re: Methods Support

    Thanks for the tip. I'll try to get the new provider.

    Thanks
    Hisham
    Thank You, Hisham

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured