Results 1 to 2 of 2

Thread: Applying an SQL statement to an ADO recordset...

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2001
    Location
    London
    Posts
    29

    Applying an SQL statement to an ADO recordset...

    How could I apply an SQL statement to the following recordset?:

    cn.Open
    Set rs = New ADODB.Recordset
    rs.Open "Customers", cn, adOpenKeyset, adLockPessimistic, adCmdTable


    Would I have to set it in the rs.open line?? If so where should it go?

    Thanks in advance!

    Rob.

  2. #2
    Hyperactive Member goatsucker's Avatar
    Join Date
    Dec 2002
    Location
    Leeds, England
    Posts
    283
    Try
    VB Code:
    1. rs.Open "SELECT * FROM Customers", cn, adOpenKeyset, adLockPessimistic, adCmdText
    but replace "SELECT * FROM Customers" with your query
    After all "Rust Never Sleeps"

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