Solved

Dbgrid with Sql

Posted on 2000-05-11
2
129 Views
Last Modified: 2010-05-18
I create a SQL’s string, but I don’t know what I have to do for load the results in a dbgrid, I mean, I want the data in which column. I need an example
to fill the columns with the results of the SQL's string.
0
Comment
Question by:JorgeLuis
2 Comments
 
LVL 28

Accepted Solution

by:
AzraSound earned 50 total points
ID: 2802916
set the datasource of your dbgrid to the recordset you create via your sql string...if youre using a data control set its datasource equal to that...if youre using recordset objects
(e.g.,
Dim rs As Recordset
Set rs = New Recordset
rs.Open "Select * from Table")

then set the dbgrid's datasource equal to that recordset
0
 
LVL 2

Expert Comment

by:Simonac
ID: 2804376
Ti fill the dbgrid just do like azra suggested, but if u want to CHOOSE which field will be showed and in which column, u can right click on the dbgrid, go in properties, tab - columns and there u can specify field and column header for eacgh column, as well as how many column u want to see.

hopes this helps
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

759 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