Differences between DAO & ADO

o1110010

Registered User.
Local time
Today, 12:59
Joined
Mar 6, 2004
Messages
182
Confused about the differences..

I'm trying to get a grip on ADO but I think I should have made sure I had a grasp of DAO first. :confused: Now even the simplest Sub Procedure isn't working in my database but it was working last week! All due to me trying to switch the code around to use ADO and lose the DAO references.

Can someone be so kind and take a minute to plop down a DAO example? Afterwards perhaps someone with ADO knowledge convert it?

If you would like to even help me out even more, the example could pertain to my procedure that's not working anymore. :o Simple.. (well, was before I dove into ADO) references one table with four fields. Procedure is triggered by the user pressing a button on a form. The procedure adds a record (fills in the next four fields). It actually added X number of records (determined by a text field on the form) but I should be able to figure that out again.

I feel so inept. :(
 
This thread has some basic code to work with recordsets in DAO and ADO: Navigate a Query. Mile-O-Phile posted code for adding data to combo boxes in both DAO and ADO in the FAQ section.

If you need some specific code translated, post it and we'll see what we can do.
 
dcx693 saves the day

WOW! GREAT examples of the basic structures between DAO and ADO.

i should be back on track tonight!

i think i was mostly stuck on "Connection" in ADO. my prior experience makes me think of sockets or other kind of connections to non-related external sources. it's nice to see most of the structure remains the same.

thanks a bunch! A+ work dcx693. :D
 
Cool links, especially that first one. (the third didn't work for me.. *shrug*)

in my march toward understanding ADO..
is there more than one way to edit a recordset in ADO?

i am getting an error when i try to put examples of code i've seen on other posts.
Code:
.Fields("MyField") = "NewValue"

right now, here is a snipet of the code i have currently...
Code:
With rst
.AddNew
rst(Date) = #12/21/2003# 
.Update
it compiles with no errors in that section.
 
Pat Hartman said:
And finally, are you really adding a record with only a single date field?

Heh. No, it's adding to four fields. I needed help to figure out how to add to ADO rst. And it won't be adding the constant #12/31/2003# I just used it to narrow down bad code. The date will change pertaining to the current record ID. ... Which may be the next question if I can't figure it out. :p I have it working in an update query with
Code:
DateAdd("d",[ID],#12/31/2002#)
but I didn't get that far yet.

Thanks so far! :D
 

Users who are viewing this thread

Back
Top Bottom