Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8962533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:08:52+00:00 2026-06-15T16:08:52+00:00

I have a test project I’m using to familiarise myself with VB6. Just a

  • 0

I have a test project I’m using to familiarise myself with VB6. Just a listbox, a button to get info, and a button to clear info:

VB6 Form

Code:

Option Explicit

Private Sub btnGet_Click()
    lstResults.DataSource = GetMenuItems
End Sub

Private Sub btnClear_Click()
    lstResults.Clear
End Sub

Public Function GetMenuItems() As ADODB.Recordset
    Dim rs As ADODB.Recordset

    Dim conn As New ADODB.Connection
    conn.ConnectionString = "File Name=C:\connString.udl"

    Dim cmd As New ADODB.Command
    Set cmd.ActiveConnection = conn
    cmd.CommandType = adCmdStoredProc
    cmd.CommandText = "dbo.GetMenuItems"
    Set rs = cmd.Execute()
    GetMenuItems = rs
End Function

The following error appears when I click the Get Items button (btnGet):

Compile Error: Method or Data Member Not Found

At first I thought it might be something to do with the event/button, that some sort of binding between them wasn’t present. But just putting in something like “MsgBox(“Hello”)” works fine. Yet it doesn’t even seems to get to the line where the GetMenuItems function is called before throwing the error.
This being my first whirl with VB, I’m a little stumped.

EDIT – I’ve had a look at the UDL file I was using too. Tested that and its connecting ok on its own.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:08:53+00:00Added an answer on June 15, 2026 at 4:08 pm

    In Sub btnGet_Click, use

    Set lstResults.DataSource = GetMenuItems
    

    Assigning object references without using Set is hardly ever the right thing to do. For what it’s worth, omitting Set references the left-hand side’s default property; this was part of VB6 (OK, VB4, when classes were introduced) as a help to VB3 programmers, before there were such things as objects. Whatever kind of object lstResults.DataSource returns likely does not have a default property, leading to the “Method or data member not found” error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Unit test project for my Application using DUnit framework. This project
I have this simple test project just to test the IncludeExceptionDetailInFaults behavior. public class
I have a VS2010 unit test project set to using SpecFlow 1.8.1 and mstest.
I have setup an android test project that runs junit tests. It's using two
I have a test project using MbUnit and TestDriven.Net. If I right-click on an
I have a test project on TypeScript, code can found here . When I'm
I have a simple test: def test_project_info_form_post_submission(self): Test if project info form can be
Using AdMob in MonoTouch Projects with iOS SDK 4.2 We have a test project
I have a test project using Log4net. When I add a class library (from
I have a test project for my actual code that resides in another project.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.