Connect to a table

J

JoeandTel

in VBA how do I use a sql statement to obtain data? How do I create a record set?
 
A

Adrian Jansen

Recordset occurs as both DAO and ADO. You probably want DAO, use

Dim rs as DAO.Recordset

Also your SQL needs a semicolon to end:

Set rs = CurrentDb.OpenRecordset("SELECT * FROM Employee;")

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top