Populate a DataGrid from a RS without AdoDc? 
Author Message
 Populate a DataGrid from a RS without AdoDc?

Hi
I have spent days trying to find a way to populate the datagrid
dierctly from a recordset without using the adoDc or dataenvironment.
Ie I want to do something like this:

Set RS1 = New ADODB.Recordset
RS1.CursorType = adOpenStatic
Set DbConn = New ADODB.Connection
DbConn.Open gConnectString
Sql = "SELECT *  FROM " & TableName & ""
RS1.Open Sql, DbConn, , , adCmdText
'now the part that won't work:
        DataGrid1.DataSource=RS1

The MSHFlexiGrid has a method that works like I want eg:
Set MSHFlexGrid1.Recordset = RS1

But this is a write only grid!
Can anyone help me out?

Regards from Graham Lambert



Sun, 25 Apr 2004 15:45:22 GMT  
 Populate a DataGrid from a RS without AdoDc?
Try this
...your code...
Set DataGrid1.DataSource=RS1.DataSource

It should solve the problem

Jose

Quote:
>-----Original Message-----
>Hi
>I have spent days trying to find a way to populate the
datagrid
>dierctly from a recordset without using the adoDc or
dataenvironment.
>Ie I want to do something like this:

>Set RS1 = New ADODB.Recordset
>RS1.CursorType = adOpenStatic
>Set DbConn = New ADODB.Connection
>DbConn.Open gConnectString
>Sql = "SELECT *  FROM " & TableName & ""
>RS1.Open Sql, DbConn, , , adCmdText
>'now the part that won't work:
>    DataGrid1.DataSource=RS1

>The MSHFlexiGrid has a method that works like I want eg:
>Set MSHFlexGrid1.Recordset = RS1

>But this is a write only grid!
>Can anyone help me out?

>Regards from Graham Lambert
>.



Sun, 25 Apr 2004 21:02:30 GMT  
 Populate a DataGrid from a RS without AdoDc?
Thanks, it works

On Wed, 7 Nov 2001 05:02:30 -0800, "Jose Simas"

Quote:

>Try this
>...your code...
>Set DataGrid1.DataSource=RS1.DataSource

>It should solve the problem

>Jose

>>-----Original Message-----
>>Hi
>>I have spent days trying to find a way to populate the
>datagrid
>>dierctly from a recordset without using the adoDc or
>dataenvironment.
>>Ie I want to do something like this:

>>Set RS1 = New ADODB.Recordset
>>RS1.CursorType = adOpenStatic
>>Set DbConn = New ADODB.Connection
>>DbConn.Open gConnectString
>>Sql = "SELECT *  FROM " & TableName & ""
>>RS1.Open Sql, DbConn, , , adCmdText
>>'now the part that won't work:
>>        DataGrid1.DataSource=RS1

>>The MSHFlexiGrid has a method that works like I want eg:
>>Set MSHFlexGrid1.Recordset = RS1

>>But this is a write only grid!
>>Can anyone help me out?

>>Regards from Graham Lambert
>>.

Regards from Graham Lambert


Sun, 25 Apr 2004 23:47:39 GMT  
 Populate a DataGrid from a RS without AdoDc?
Instead of
    DataGrid1.DataSource=RS1
try
    Set DataGrid1.DataSource = RS1

The DataSource property is an object.



Mon, 26 Apr 2004 00:30:08 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Use DataGrid Control Without ADODC

2. Populate DataGrid From Text File - Without ADO.NET

3. How to populate Combo box with ADO/RS

4. Populate ListView RS Error

5. MSHFlexGrid populating from ADODC

6. populating datacombo with adodc in code

7. Pl Help, Populating datacombo from ADODC

8. Problem populating dbcombo with adodc

9. Populating ADODC from a Stored Procedure

10. Can't save BLOB from RS to Variable to File without extra char's

11. Use ADODC without adding to form ?

12. hook disconnected ADR rs to a datagrid

 

 
Powered by phpBB® Forum Software