Solved

displaying data on dbgrid...interesting but tough

Posted on 1998-04-01
1
162 Views
Last Modified: 2012-05-04
how do i display data from two tables in my database in a dbgrid?
codes pls
0
Comment
Question by:icesurfer
1 Comment
 
LVL 1

Accepted Solution

by:
VBert earned 50 total points
ID: 1460154
Add a dbgrid and a data control to your form. Set the dbgrid's .DataMode property to BOUND and it's .DataSource property to DATA1 (the name of your data control.)

Set the Data1.Database to the name of your database, and the Data1.Recordsource to an sql statement that does a join of the two tables you want.

For example, if you have a table of book authors and a table of
book titles, the common field between the two table being author, your sql statement would look something like this...

"SELECT * FROM AUTHORS, TITLES WHERE TITLES.AUTHOR_NAME = AUTHOR.NAME"

When you refresh your data control, the results should show up in your grid.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

867 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now