Solved

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

Posted on 2006-10-31
6
7,882 Views
Last Modified: 2008-02-20
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

0
Comment
Question by:estewb
6 Comments
 
LVL 5

Expert Comment

by:lunchbyte
Comment Utility
Did you declare something wrong? You may have declare something but forget to reference it to the project.

0
 
LVL 5

Expert Comment

by:lunchbyte
Comment Utility
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.
0
 
LVL 18

Accepted Solution

by:
JR2003 earned 125 total points
Comment Utility
If you have two refernces that each contain a 'Column' type. The one that's first in the list will be selected, this might not have the 'DataField' attribute.
You need to workout which reference you wwant the column object from and put it higher in the list of references ot prefix the line: Dim c As Column with the libray. I'm not sure what it is called but it would be something like:
Dim c As dgLibrary.Column
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 76

Expert Comment

by:GrahamSkan
Comment Utility
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.
0
 
LVL 1

Expert Comment

by:Clivous
Comment Utility
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
0
 
LVL 18

Expert Comment

by:JR2003
Comment Utility
Use this to dim the variable c instead:

Dim c As MSDataGridLib.Column
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now