DbGrid + DataSource
I have to maintain in an old code here, and I have to migrate the database "Access" to "MSSQL".
So far so good ... The consultations, inclusions and exclusions are all done.
The problem is that there is a "DBGrid" here, that takes a "data" object as "DataSource".
This object in turn, opened a database "access", carrying a table and populate the "DbGrid.
I would like this populate this "DBGrid" using a "Recordset". Itīs possible?
For thus, I would do the query and populate a "grid" with the result.
I wouldn't use a grid as a replacement, I'd use a ListView which is easily populated using a recordset.
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
DBGrid is obsolete.
Use DataGrid, instead.
Using ADO become simple to populate DataGrid with a ADO recordset (without a DAO Data control or ADO Data control).
Create your ADO Recordset then assign them to DataGrid:
Dim cn as ADODB.Connection
Dim rs as ADODB.Recordset
Set cn = new ADODB.Connection
Set rs = new ADODB.Recordset
cn.ConnectionString = <your_string_database_connection>
cn.CursorLocation = adUseClient
rs.Open "SELECT * FROM table_name", cn, adForwardOnly, adReadOnly, adCmdText
Set DataGrid1.DataSource = rs
I´ll do this now !
By premartha in forum ASP.NET
Last Post: 11-19-2005, 02:13 AM
By mona&Shuhada in forum VB Classic
Last Post: 04-27-2001, 12:09 AM
By Goran in forum VB Classic
Last Post: 06-16-2000, 09:19 AM
By FOXFI in forum VB Classic
Last Post: 06-08-2000, 02:32 PM
By Nick Koszykowski in forum VB Classic
Last Post: 03-28-2000, 03:21 PM
Tags for this Thread
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center