Link to home
Start Free TrialLog in
Avatar of damienm
damienmFlag for United Kingdom of Great Britain and Northern Ireland

asked on

ADO and DBGrid

I have used dbGrid using RDO but I want to use ADO and SQL TO populate a dbGrid?
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

What is your question?
If you want to use ADO, make sure you use the ADO DataGrid (MSDATGRD.OCX) and ADO Adodc (MSADODC.OCX). They work fine.
Avatar of jasonboetcher
jasonboetcher

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
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial