Using Ado

harrisw

Registered User.
Local time
Today, 02:19
Joined
Mar 27, 2001
Messages
131
Can anyone help with some simple issues

Im used to using dao

dim db as database
dim rs as recordset

set db = currentdb
set rs as db.openrecordset("dfsfdfsdf")


etc

How do i do this in ADO
 
Code:
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset

Set cn = CurrentProject.Connection
Set rs = New ADODB.Recordset

rs.Open "MyTable", cn, acOpenStatic, acLockPessimistic

With rs
    .AddNew
    .Fields("MyField)
    .Update
    .Close
End With

Set rs = Nothing
Set cn = Nothing


dcx693 and myself gave examples of using DAO and ADO on this thread.


I take it you have upgraded from 97 to 2000 or 2002? If you would reather use DAO you can set a reference to the DAO library over the ADO library.
 
Thanks for that it helped a lot.

Another question for you.

How can I create a table using ADO and add fields to it.
 
harrisw said:
How can I create a table using ADO and add fields to it.

Please stick to this thread that you've started on the subject. We don't want two separate threads discussing the same thing now, do we? ;)
 
Durn it Mile! Why couldn't you have been a little faster? :D Could've saved me some typing!
 
dcx693 said:
Durn it Mile! Why couldn't you have been a little faster? :D Could've saved me some typing!

Then how's that for a magic trick? ;)
 
Whoa....what happened there? I thought I typed in a bunch of stuff...but now it's gone. Poof. :confused:

How'd that happen? I must've done something like:
Set post=Nothing

:)
 

Users who are viewing this thread

Back
Top Bottom