Solved

Dbgrid with Sql

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

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 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…
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…

717 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