Results 1 to 12 of 12

Thread: ADO or DAO

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    Question

    really confused
    til THIS day i thought i had referenced ADO
    i checked my project
    and DAO was selected

    DAO 3.51 to be exact

    and when i have like
    public db as database
    it works fine
    but how do i change it to ADO and still have that declaration working?

    thanks
    am so confused about this

  2. #2
    Member
    Join Date
    Jan 2000
    Location
    Quantico, VA, USA
    Posts
    41

    Angry

    sorry, kovan, you can't. in ado, there is not a database object. look into a adodb.connection object in help. that's what replaced the database objects. it's relatively easy to use. keep in mind that there are still some limitations to ado functionality, so you might be better off (depending) on using dao after all.
    chuck
    To err is human, but to apologize frequently is embarassing.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    Angry which one should i pick?

    between DAO and ADO which one should i use to do a access db
    adding, modifying recordS?

  4. #4
    Member
    Join Date
    Jan 2000
    Location
    Quantico, VA, USA
    Posts
    41

    Red face

    microsoft is going with ado. they (plan to) eventually do away with dao, but ado isn't up to the task yet. the only real problem with ado at the time is that i don't think there's a way to compact and repair databases on the fly. you can always shell a second utiliy to take care of this, or fix it any number of ways. i use ado because of the continuing support. dao also does a lot with password protection and groups and stuff that i'm not sure if ado does, but i don't think so. if you are working with a relatively small database in which you will mainly update or add data, and you have a trustworthy database administrator, then ado is the way to go. if a lot of data is coming in AND leaving your database or you don't trust the dbadmin, then go dao and compact and repair to keep it manageable. your call.
    chuck

    ps. if you're just learning, pick one. they're close enough alike for it not really to matter
    To err is human, but to apologize frequently is embarassing.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    Red face hmm

    well i am somewhere new and somewhat not hehe

    when i started this project
    i thought i was doing ado..
    today i just happen to look at my reference a little carefully and saw that i was using DAO
    but your right, they are closely alike

    like .addnew, .update, .edit ect

    all my records are declated as rs as recordset...

    i dont know if its worth changing them all to ado
    you would know more...


    thanks for the replies

  6. #6
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Look at it this way. If you're new (and you say you are), do you want to learn 2 database access methods or one? If your answer is one, Learn ADO else learn both.

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    Red face is it worth it...

    like i mentioned above.... i have done my whole project using DAO (thinking i did it in ADO) since their syntax for going throu records, and sql statements are close to similiar

    ya i want to learn ado more than dao, dao is toast in future

    but should i convernt my project to ADO
    or keep it the way it is?


  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Definitely convert to ADO. There is little against using it with a supported provider (like Jet, SQL server).

    And it seems faster...does anyone else have any experience of comparing speeds?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  9. #9
    Member
    Join Date
    Jan 2000
    Location
    Quantico, VA, USA
    Posts
    41

    Talking

    i took a professional class on it, and it is faster ... depending on what you're working on. ADO supports multiple platforms easier, but DAO is more efficient (supposedly) for MDB files. when i get the time, i'll post a list of comparison info for you guys.
    chuck
    To err is human, but to apologize frequently is embarassing.

  10. #10
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Yeah, that would be helpful.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    Unhappy i think i will convert

    after realizing my coding sucks

    i decided to change my coding if it wont take more than a week of time

    here are few things i like to know
    (question mark(?) representing what woudl ADO version would be..


    dao" dim db as database"
    ado "?"

    dao "dim rs as recordset"
    ado "?"

    dao "set db = OpenDatabase("myBadDatabase.MDB")"
    ado "?"

    dao "sql="SELECT * FROM MyTable""
    "set rs = db.opendatase(sql)"
    ado "?"

    HERE IS A EXAMPLE FROM MY PROJECT (DAO)
    if anyone would be kind enough to rewrite that with ADO
    i would greatly appreciated, since it will help me do my conversion

    Code:
    Public Sub LoadManufacturer(cboBox As Object, Optional idx As Integer = -1)
    
        SQL = "SELECT * FROM manufacturer"
        Set ManufRecord = MeterInfo.OpenRecordset(SQL)
        
        With ManufRecord
            If .EOF Then
                MsgBox "ERROR: Manufacturer table found to be empty"
            Else
                If idx = -1 Then
                    Do Until .EOF
                        cboBox.AddItem !Manu
                        .MoveNext
                    Loop
                    'cboBox.ListIndex = 0
                Else
                    Do Until .EOF
                        cboBox(idx).AddItem !Manu
                        .MoveNext
                    Loop
                    'cboBox(idx).ListIndex = 0
                End If
            End If
            
        End With
        
    End Sub

  12. #12
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    The database object has (from a systems POV), been replaced by the Connection object. The Recordset is still there, though. It mostly works in the same way, once you've actually connected.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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