Solved

ADO and DBGrid

Posted on 2000-02-17
4
1,134 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
Comment Utility
What is your question?
0
 
LVL 1

Expert Comment

by:ca_heckler
Comment Utility
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
Comment Utility
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 69

Accepted Solution

by:
Éric Moreau earned 50 total points
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now