Solved

Access Query in VB5

Posted on 1998-06-11
5
212 Views
Last Modified: 2011-09-20
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?
0
Comment
Question by:wclare
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
clifABB earned 100 total points
ID: 1463135
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
 

Author Comment

by:wclare
ID: 1463136
I tried that but didn't get the query listed in the dropdown box for the recordsource.
0
 
LVL 6

Expert Comment

by:clifABB
ID: 1463137
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
 

Expert Comment

by:qizhizhu
ID: 1463138
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
 

Author Comment

by:wclare
ID: 1463140
It is working now.  I must have been trying to set a control box rather than the data control.  Thanks all
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month7 days, 17 hours left to enroll

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question