Results 1 to 5 of 5

Thread: RecordSEt?

  1. #1
    Join Date
    Jan 2004
    Location
    Toronto, Canada
    Posts
    259

    Unanswered: RecordSEt?

    In ADO;

    for example i initialize a recordset variable, rec;


    Dim conn as ADODB.Connection
    conn = CurrentProject.Connection

    rec.Open "CustomersTbl", conn, adOpenForwardOnly, adLockReadonly

    how do i access for example, the field in that table named "CstName" and access its value? How would i search through that field for a CstName = "somename"

    thx, help appreciated

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: RecordSEt?

    Originally posted by Jerrie
    In ADO;

    for example i initialize a recordset variable, rec;


    Dim conn as ADODB.Connection
    conn = CurrentProject.Connection

    rec.Open "CustomersTbl", conn, adOpenForwardOnly, adLockReadonly

    how do i access for example, the field in that table named "CstName" and access its value? How would i search through that field for a CstName = "somename"

    thx, help appreciated
    I use the column offset (column number - REMEMBER: 0 based) ...

    Ex:
    MyRecSet.Fields(1).Value

  3. #3
    Join Date
    Jan 2004
    Location
    Toronto, Canada
    Posts
    259
    how would i search through the MyRecSet for a specific field with a specific value?

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by Jerrie
    how would i search through the MyRecSet for a specific field with a specific value?
    Question: Why would you want to? If you're looking for a specific value in a specific field query for it. That record will be the 1st one in the list. No searching needed.

  5. #5
    Join Date
    Jan 2004
    Location
    Toronto, Canada
    Posts
    259
    oh yeah, stupid me; thx (and SQL queries are faster in code too)

Posting Permissions

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