Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ADO and DBGrid

Posted on 2000-02-17
4
Medium Priority
?
1,145 Views
Last Modified: 2013-11-23
I have used dbGrid using RDO but I want to use ADO and SQL TO populate a dbGrid?
0
Comment
Question by:damienm
4 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 2531612
What is your question?
0
 
LVL 1

Expert Comment

by:ca_heckler
ID: 2531963
If you want to use ADO, make sure you use the ADO DataGrid (MSDATGRD.OCX) and ADO Adodc (MSADODC.OCX). They work fine.
0
 

Expert Comment

by:jasonboetcher
ID: 2532045
Using the ADO DataGrid with the ADO DataControl is very simple.  

Set the Datasource property of the ADO Datagrid to whatever you named your ADO DataControl.  Then use your SQL statement as the Recordsource property of your ADO DataControl.  Refresh the ADO DataControl and that's it.

dgdData.DataSource = adoData
strSQL = "SELECT * FROM [Accounts]"
strOrder = " ORDER BY [Account Num]"
adoData.RecordSource = strSQL & strOrder
adoData.Refresh
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 150 total points
ID: 2532359
DBGrid doesn't accept ADO recordset. The only way you can use DBGrid with ADO will be to manually populate the grid control.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
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…
Suggested Courses

916 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