DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Re: To Kathleen on ADO Connection

  1. #1
    eddie Guest

    Re: To Kathleen on ADO Connection

    Hi, Kathleen!

    Private Sub Command1_Click()
    Dim rs As ADODB.Recordset
    Dim cn As New ADODB.Connection

    cn.ConnectionTimeout = 100

    cn.Open "dsn=data collection;uid=;pwd=;"
    rs.Open "select * from freezer"

    DataGrid1.DataSource = rs
    End Sub

    When I run the program, I got an error message saying "Method or data member
    not found". What is the correct
    way to do this?


    "Kathleen Dollard-Joeris" <> wrote:
    >Could you clarify your question? Particularly "use codes"
    >Reply in the newsgroup so everyone can benefit
    >eddie <> wrote in message news:39730911$
    >> Can anybody tell me how to use codes to set up an ADO connection and

    >> info an sql table?
    >> Thanks


  2. #2
    Miroslav St. Jeliazkov Guest

    Re: ADO Connection

    Hi Eddie,

    I think you forgot to create the object with Set ... As New
    Here is a code I work with:

    '===Begin of Code===
    Set connMain = New ADODB.Connection
    connMain.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & MainDB

    Set rstGroups = New ADODB.Recordset

    rstGroups.Open " SELECT * " & _
    " FROM Tools " & _
    " WHERE ToolID = '" & strID _
    , connMain, adOpenKeyset, adLockPessimistic
    '===End of Code===

    and I have project reference to ADO350.dll 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
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center