Link to home
Start Free TrialLog in
Avatar of estewb
estewb

asked on

VB6 - "Compile error: Method or data member not found." on DataGrid code

I have a VB 6.0 project that JUST started giving me an error on compile.

I originally wrote this application a couple of years ago and have added to its capabilities many times through the past couple of years.  There are many things included in it, including a number of Crystal Reports, external OLE calls, etc.  At any rate, I recently started working on it again for the client, adding another OLE call to Microsoft IE to capture and parse Web information; and I must have done something to it; but for the life of me, I cannot figure out what it is!  It suddenly simply will not compile.  I've played around a good bit with the Components and References, thinking that was the obvious answer.  Currently, Components, Designers, and References are (I listed everything!):

COMPONENTS:
Crystal ActiveX Query Viewer 1.0 Type Library
Crystal Report Control
Crystal Report Viewer Control
Crystal Select Expert OLE Control Module

Microsoft ADO Data Control 6.0 (SP6) (OLEDB)
Microsoft Common Dialog Control 6.0 (SP6)
Microsoft DataGrid Control 6.0 (SP6) (OLEDB)
Microsoft DataList Controls 6.0 (SP6) (OLEDB)
Microsoft Internet Controls
Microsoft Masked Edit Control 6.0 (SP3)
Microsoft PictureClip Control 6.0 (SP3)
Microsoft Rich Textbox Control 6.0 (SP6)
Microsoft Tabbed Dialog Control 6.0 (SP6)
Microsoft Windows Common Controls 6.0 (SP6)
Microsoft Windows Common Controls-2 6.0 (SP6)

DESIGNERS:
Crystal Reports 8
Data Environment
Data Report
DHTML Page
Microsoft Forms 2.0 Form
WebClass

REFERENCES:
Visual Basic For Applications
Visual Basic runtime objects and procedures
Visual Basic objects and procedures
Crystal Report Viewer Control
Cyrstal Report 8 ActiveX Designer Run Time Library
Crystal Report 8 ActiveX Designer Design Time Library (Internal)
Crystal ActiveX Query Viewer 1.0 Type Library
Crystal Report 8 Standard Wizard library
Crystal Report Engine 8 Object Library
Crystal Report Export
Crystal Report Viewer Control
Crystal Reports 8 Library
Crystal Data Object
cryptext 1.0 Type Library
Microsoft Management Console 2.0
Microsoft Internet Controls
Microsoft ActiveX Data Objects (Multi-dimensional) 2.8 Library
Microsoft Data Report Designer 6.0 (SP4)
Microsoft Data Source Interfaces
Microsoft ActiveX Data Objects 2.5 Library
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects Recordset 2.8 Library
OLE Automation
Now, it gets past the error on "Picture" type; but throws a new error on some Datagrid control code that previously was compiling without a hitch:


    Set dgEMailList.DataSource = swsExpRS

    Dim c As Column
    For Each c In dgEMailList.Columns
        Select Case c.DataField     [<== ERRORS OUT RIGHT HERE]
            Case "ID"
                c.Visible = True
                c.Caption = "ID #"
                c.Width = 950
            Case "Licensees name"
                c.Visible = True
                c.Caption = "Name"
                c.Width = 1900
            Case "Email address"
                c.Visible = True
                c.Caption = "E-Mail Address"
                c.Width = 2800
            Case "Zip code"
                c.Visible = True
                c.Caption = "Zip"
                c.Width = 950
            Case "FailureCount"
                c.Visible = True
                c.Caption = "# Failures"
                c.Width = 950
            Case "Matched"
                c.Visible = True
                c.Caption = "Matched?"
                c.Width = 1000
            Case Else ' Show all other columns.
                c.Visible = True
        End Select
    Next c

The error says, "Compile error:  Method or data member not found."

The really puzzling thing is that I have been compiling this thing for years; and suddenly it won't compile.   I've got the ADO Data Control 6.0, the Datagrid Control 6.0 AND Datalist Control 6.0 already included.  Any help will be GREATLY appreciated!

estewb

Avatar of lunchbyte
lunchbyte

Did you declare something wrong? You may have declare something but forget to reference it to the project.

When I use one of my DLL, I may have moved it or forget to update the dll name, this is the exact same error I will get. Even it will point out my select case is wrong but it was the DLL or reference that I forget to update or add.
ASKER CERTIFIED SOLUTION
Avatar of JR2003
JR2003

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What sort of Column are you wanting to Dim.
You probably have more than one column Object in that list of References. Unless you specify, it will use the first on that it finds.
Hi,

I think the posters above me a right.
Do not and never use Dim c As Column again. Put always the lib name before the class definition!

Good luck,
Hans
Use this to dim the variable c instead:

Dim c As MSDataGridLib.Column