Results 1 to 4 of 4

Thread: ADO seek method

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 1999
    Location
    Dubai, U.A.E.
    Posts
    2

    Post

    Why the following code gives an error message
    at
    <rst.Index = "PrimaryKey">
    "Compile error
    Method or data member not found"


    Dim cnn As New ADODB.Connection
    Dim rst As New ADODB.Recordset

    Set cnn = New ADODB.Connection
    cnn.Open "provider=Microsoft.Jet.OLEDB.4.0;data source = c:\project\vb\access\masters.mdb;"

    Set rst = New ADODB.Recordset
    rst.Index = "PrimaryKey"
    rst.Open "Itemmast", cnn, adOpenKeyset, adLockOptimistic, adCmdTableDirect

    rst.Seek "=", Text1.Text
    If Not rst.EOF Then
    Form1.Text2.Text = rst.Fields(1).Value
    End If
    rst.Close

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    ADO's Recordset object doesn't have Seek method. It has Find method.

    Usage:rs.Find Criteria, [Skip Records As Long], [Search Direction As SearchDirectionEnum=adSearchForward], [Start]

    Example:rs.Find "LastName Like 'A%'"

    Regards,

    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]




    [This message has been edited by Serge (edited 09-27-1999).]

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 1999
    Location
    Dubai, U.A.E.
    Posts
    2

    Post

    Thanks for your information.

    I found some examples in MSDN Library (July 1999) under the following heading

    "Microsoft Data Access Components 2.5 SDK Beta - ADO"

    Is the above one is a new component ?


    Thanks & Regards

    Vijman

  4. #4
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    ADO 2.5 will be released with Windows2000. The new version of ADO will have XML support (which is pretty cool, I've seen it in action on Microsoft DevDays conference).

    Regards,

    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]



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