Access Query in VB5

Can someone tell me hoe (If at all) I can create a query in Access 97 and use it as a recordsource for a data control in VB5?
wclareAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
clifABBConnect With a Mentor Commented:
Create your query in Access as you normally would.

Once in VB, after you drop your data control on a form, set the database property to the correct mdb file, then the recordsource will have the query listed amongst the tables.

It's a good idea to name your queries with the letters qry at the beginning. (ex: qryCostTotals)

Field names will work just as if you had attached to a table.
0
 
wclareAuthor Commented:
I tried that but didn't get the query listed in the dropdown box for the recordsource.
0
 
clifABBCommented:
Hmmm.  Very odd indeed.  I tried it before I answered just to make sure it worked.

Some silly questions:
Do you get the tables listed?
What is the name of the query?
Is the name of the query the same as the name of a table?
0
 
qizhizhuCommented:
try to set data control on your VB firm first. then get your VB database name match your "mdb" database. then set down other properties. Another way is to use Active X control. If you still confuse, let me know. also you can refer to VB help to work through.
0
 
wclareAuthor Commented:
It is working now.  I must have been trying to set a control box rather than the data control.  Thanks all
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.