Solved

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

Posted on 2006-10-31
6
8,028 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
String manipulation in Visual Basic 7 73
Protecting vb6 & .Net code Obfuscation 18 152
Can we place a tooltip on the actual vb6 form 5 48
Dinamic report to Crosstab query 9 34
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

828 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