Results 1 to 5 of 5

Thread: Help with ADO

  1. #1
    Join Date
    Dec 2002
    Posts
    60

    Unanswered: Help with ADO

    I'm trying to teach myself ADO. I have some limited DAO experience. My problem is where to start-would someone please convert the following two snippets to ADO, it will help me. Also any suggestions on reading material/links would be appriciated:

    Dim rstMy as DAO.Recordset
    Set rstMy=Me.RecordsetClone
    rstMy.FindFirst "Field=" & Me.txtWhatever
    Me.Bookmark=rstMy.Bookmark
    rstMy.Close
    Set rstMy=Nothing
    And:

    Dim rstMy as DAO.Recordset
    Set rstMy=CurrentDB.OpenRecordset("SELECT ...")
    Thanks,
    bc301

  2. #2
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    Quote Originally Posted by bc301
    I'm trying to teach myself ADO. I have some limited DAO experience. My problem is where to start-would someone please convert the following two snippets to ADO, it will help me. Also any suggestions on reading material/links would be appriciated:

    Dim rstMy as DAO.Recordset
    Set rstMy=Me.RecordsetClone
    rstMy.FindFirst "Field=" & Me.txtWhatever
    Me.Bookmark=rstMy.Bookmark
    rstMy.Close
    Set rstMy=Nothing
    And:

    Dim rstMy as DAO.Recordset
    Set rstMy=CurrentDB.OpenRecordset("SELECT ...")
    Thanks,
    bc301
    your first snippet cannot use ADO since form's recordset is still in DAO
    but your second snippet wouls like this

    dim rstMy as ADO.Recordset
    Set rstMy = New ADO.Recordset
    rstMy.Open <SQL>, CurrentPoject.Connection

  3. #3
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346
    Here is another example:

    Dim cn as ADODB.Connection
    Dim rs as ADODB.Recordset

    Set cn = new ADODB.Connection
    cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Password=TestPass;Data Source=C:\Test.mdb;Persist Security Info=False;Exclusive=0"
    cn.open

    set rs = new ADODB.recordset
    rs.ActiveConnection = cn
    rs.Open "SELECT * FROM Table1"

    rs.Close
    cn.Close
    Set rs=Nothing
    Set cn = Nothing
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

  4. #4
    Join Date
    Dec 2002
    Posts
    60
    Thanks both for the replies.

    "your first snippet cannot use ADO since form's recordset is still in DAO"
    No wonder I couldn't figure it out!

  5. #5
    Join Date
    Oct 2003
    Posts
    311

    Unhappy Scirocco Off-shore

    From SCIROCCO Web site :

    We also offer a new Off-Shore model. All work is reviewed by local Canadians who insure your satisfaction and peace of mind.


    I don't think too many Americans or others on this site that aren't from 3rd world countries appreciate your support of exporting tech jobs.

Posting Permissions

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