Solved

ADO and DBGrid

Posted on 2000-02-17
4
1,137 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 50 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

831 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