Solved

Dbgrid with Sql

Posted on 2000-05-11
2
134 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

763 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