English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How to show a record set generated from a sql statement in DataGrid Control..say adoRecordSet how to get this record set in to datagrid?

2006-08-07 04:45:08 · 4 answers · asked by indrakeerthi 2 in Computers & Internet Programming & Design

4 answers

In COMPONENTS check mark the following and place them on your form:
Microsoft ADO Data Control 6.0 (SP4) (OLEDB)
Microsoft DataGrid Control 6.0 (SP5) (OLEDB)

Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\test.mdb"
Adodc1.RecordSource = "SELECT * FROM Table1"
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End Sub

2006-08-07 23:25:37 · answer #1 · answered by VBACCESSpert 5 · 1 1

Hai Poojitha,
Place an adodc control on the form and provide the connection string in it and in that control there will be option to give sql query, give it. Specify the data source of datagrid control to Adodc and data field to member retrieved from query.

Bye Alex

2006-08-07 12:02:05 · answer #2 · answered by Alex 1 · 0 0

set the Datasource property of that grid

2006-08-07 11:53:37 · answer #3 · answered by kiran k 2 · 0 0

set grid.datasource = recordset

2006-08-07 14:08:18 · answer #4 · answered by TruthIsGod 2 · 0 0

fedest.com, questions and answers