Results 1 to 4 of 4

Thread: Hierarchical Flexgrid - Error 30022

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Location
    Liverpool, UK
    Posts
    7

    Angry Hierarchical Flexgrid - Error 30022

    Can anyone help? - I have searched MSDN and these forums, but to avail.

    I am trying to populate a mshflexgrid (in VB6) with the following simple statement:

    Private Sub Form_Load()

    Dim cn As New ADODB.Connection
    Dim rs As New ADODB.Recordset

    With cn
    .Provider = "SQLOLEDB"
    .ConnectionString "server=xxxx;database=xxx_test;uid=xxxxx;password=pword"
    .Open
    End With

    rs.Open "select * from Product", cn

    Set MSHFlexGrid1.DataSource = rs

    End Sub

    The final statement, 'Set MSHFlexGrid1.DataSource = rs' produced the following error message:

    Run Time Error '30022':
    The Hierarchical Flexgrid does not support the requested type of data binding.

    I have added the Microsoft Hierarchical Flexgrid Control 6.0 (SP4) to components and added Microsoft ActiveX Data Objects 2.7 Library to References.

    That is everything there is - broken down to simplest level, yet still no joy. Can anyone help - is it a simple programming error or am I missing a component??

  2. #2
    New Member
    Join Date
    Dec 2002
    Posts
    14
    I tried to find this error in my MSDN , and found the following solution :

    SYMPTOMS
    Attempting to rebind the MSHFlexGrid to a different Data Environment as the DataSource property results in an error:
    Runtime Error 30022, The Hierarchical FlexGrid does not support the requested type of data binding.

    CAUSE
    If the MSHFlexGrid.DataMember is set to a Data Environment other than the original, the MSHFlexGrid attempts to rebind the data using the previous DataSource property setting. Because the same Command does not exist in the subsequent Data Environment, an error results.

    RESOLUTION
    To work around this problem, set MSHFlexGrid.DataSource = Nothing before rebinding to the next Data Environment.

    I hope it will work for you ....

    mmaenb
    Maen

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Location
    Liverpool, UK
    Posts
    7
    Thanks MMaenB - that didn't directly solve the problem but somehow it is fixed! Typical VB!

    I tried setting the datasource to nothing, but got the same problem. I then found I had set the datasource to rs in properties and datamember to cn, so I cleared this but with the same 30022 error.

    I was about to give up and go to a plain flexgrid when I ran the program again and found that it worked!!?? I dont know how or why, or if resetting the properties was the definitive answer, but I aint buggering around with it now!

    Cheers MMaenB!

  4. #4
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385
    ianjones007,


    The only thing that I saw that was that you should have used

    Dim rs as ADODB.Recordset

    Set rs = New ADODB.Recordset

    before using the reference in the MSHFlexGrid.Datasource statement and in the design properties of MSHFlexGrid never default set the Datasource property to anything if you are going to change it on the fly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width