Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is ADO equivalent to the following statement from DAO 1

Status
Not open for further replies.

rewdee

Programmer
Aug 17, 2001
295
US
In DAO I could write:
Code:
with currentdb.OpenRecordSet("Table1",dbopendynaset)

I don't won't to always declare the variables and write:
Code:
Dim rs as new ADODB.Recordset
rs.Open "Table1",currentProject.Connection,adOpenDynamic
with rs
...
end with

Thanks,
Rewdee
 
[bugeyed] Someting like this will do the trick:

Sub OpenTable()
With CurrentProject.Connection.Execute("Select * From [Customers]")
Debug.Print .Fields("CustName")
End With
End Sub

VBSlammer
redinvader3walking.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top