I cannot set MSFlexGrid datasource by code.

Hi everyone,

I try to simply set the MSFlexGrid datasource property and I get a 91 error : Object variable not defined.

I know that this question has been already asked (I made the search in EE but it is impossible for me to access the answer since I did not subscribe).

I made the search on google : but impossible to find the question I have seen in EE. (could you explain that to me).

Here is my code :


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

    Set cn = New ADODB.Connection

    cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Program Files\FarPointSpread\Samples\ActiveX\VB6\Demo Overview\common\Nwind.mdb;Persist Security Info=False"


    Set rs = New ADODB.Recordset

    rs.Source = "SELECT Customers.CompanyName, Orders.OrderID, Orders.OrderDate, Products.ProductName " & _
            "FROM ((Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID) " & _
            "INNER JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID) INNER JOIN Products ON [Order Details].ProductID = Products.ProductID;"

    Set rs.ActiveConnection = cn

   Set flex.DataSource = rs       <-----------------  Error 91


Thanks for your help.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
laurent_diepAuthor Commented:
Preece :

Thank you very much for your links.

I will do what they say : use MSHFlexGrid (Microsoft Hierarchical Flex Grid).

By the way don't you know why I don't get the same search results with EE and Google ?

They probably want you to sign up as a member to have access to everything...

Check the faqs and such...

laurent_diepAuthor Commented:
Yeah, I think so.

Thank again.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.