Command object, DataSource property - strange behaviour 
Author Message
 Command object, DataSource property - strange behaviour

Hi!

I use MS-Access 2000 database through ADO (provider is Jet 4.0 OLEDB
Provider). In my application I ask a query from that database using
Command object (it's a parameter query). When I execute the Command, I
get recordset. Now I want to assign this recordset to MSHFlexGrid's
DataSource property. No errors, but only one record appears in grid.

All my stuff started to work normally when I used the following (short)
code fragment:

    ' Execute the command
    Set Rs = Cmd.Execute()

    ' Close recordset, assign properties
    ' and open it again
    Rs.Close
    Rs.CursorLocation = adUseClient
    Rs.CursorType = adOpenDynamic
    Rs.Open

    'Assign recordset to MSHFlexGrid
    Set Me.dbgCustom.DataSource = Rs

If I don't close the recordset, don't assign it's cursor properties,
there's only one record in a grid again. Why?

With best regards,
Gunnar Peipman



Sun, 02 Feb 2003 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Strange behaviour of CheckListBox Object

2. Strange behaviour with remote object activation

3. Setting MSFlexGrid Datasource property to a Recordset object.

4. Datasource Behaviour (vb6)

5. strange behaviour of a subform, or a bug?

6. Strange Access behaviour or Bug, or what ?!?

7. Strange Behaviour

8. Strange behaviour of toolbars

9. XP users - Strange date behaviour

10. Strange behaviour in Word

11. DT Picker Control on Multi Page - Strange Behaviour

12. Public folders strange behaviour ?

 

 
Powered by phpBB® Forum Software