Click to See Complete Forum and Search --> : Executing MS Access Queries from VB


August 14th, 1999, 03:11 PM
Hi,

Does anyone know if it is possible to get the results or execute an already made Microsoft Access query? If so, does it require you to have MS Access installed on your machine?

Thank you, very much.

santulan
August 14th, 1999, 11:47 PM
Dear,
You can get the query directly from Access database and you do not require access installed on the client machine. In fact, I always create queries in aceess first and then call them in VB.
You can simply declare a recordset type variable
Dim myTB as recordset
set myTB = mydatabase.openrecordset("Query1")



Here, I presume that DAO 3.5 is set in preferences and mydatabase is set as database. Query1 is the name of the query you designed and tested in Access.
I hope this solves your problem.
Santulan