Solved

Dbgrid with Sql

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

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

737 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