Solved

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

Posted on 2006-10-31
6
7,983 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
ID: 17844541
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
ID: 17844548
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
ID: 17844788
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
ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 
LVL 76

Expert Comment

by:GrahamSkan
ID: 17844817
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
ID: 17848487
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
ID: 17848631
Use this to dim the variable c instead:

Dim c As MSDataGridLib.Column
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

821 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