You don't really need to set the columns to the fields
ThisForm.oDatagrid.DataSource=oRecordset
This should suffice and retrieve the records at runtime. Also check if the source property of the recordset has matching records.
Enmanuel
>I am using ADO to connect to an sql server 7 database.
>
>The connection seems to be fine, in that I can view the data in textboxes on a form and navigate through them. My problem is how do I get the data into the MS Datagrid control. It does not seem to have a data source property in the properties window. But I can put this code in the init event of the grid:
>
>this.datasource = oRec
>
>I also set the columns in the grid to oRec.fields(0), oRec.fields(1) and so on. However the grid shows no data. It does show blank records
>
>What am I missing ? And, is there a better way?
>
>Thanks in advance
>
>
>Alhad
I'm a mixture of Albert Einstein and Arnold Schwarzenegger. The only trouble is that I got Einstein's body and Schwarzenegger's brain