Hi Yann,
Thank you for using MSDN Newsgroup! It's my pleasure to assist you with your issue.
I believe Allen has pointed out that you can use OpenRecordset() to get the recordsets in a
query. Here I use DAO to draft a VBA script for your reference. Please note that in your VB
project, you should use OpenDatabase to open that Access databse rather than using
CurrentDb() as below.
'''''''''''''''''''''''''''''''''''''''
Private Sub Command0_Click()
Dim DB As DAO.Database
Dim RS As DAO.Recordset, FLD As DAO.Field
Set DB = CurrentDb()
Set RS = db.OpenRecordset("dbo_Category Sales for 1997 Query")
RS.MoveFirst
Debug.Print "Results" & vbCrLf & "---"
Do Until RS.EOF
For Each FLD In RS.Fields
Debug.Print FLD.Value,
Next
Debug.Print
RS.MoveNext
Loop
Set RS = Nothing
Set DB = Nothing
End Sub
''''''''''''''''''''''''''''''''''''
Yann, does this answer your question? Please feel free to let me know if this help solves your
problem. If there is anything more I can do to assist you, please feel free to post it in the group
Best regards,
Billy Yao
Microsoft Online Support