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?

    Thanks


    "Kathleen Dollard-Joeris" <kjoeris@noemailplease.com> wrote:
    >Eddie,
    >
    >Could you clarify your question? Particularly "use codes"
    >
    >--
    >Kathleen
    >(MS-MVP)
    >Reply in the newsgroup so everyone can benefit
    >--
    >
    >eddie <ez1115@yahoo.com> wrote in message news:39730911$1@news.devx.com...
    >>
    >> Can anybody tell me how to use codes to set up an ADO connection and

    >display
    >> 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
    ADODB.Connection
    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.

    Miro







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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

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