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 7502947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:03:17+00:00 2026-05-29T21:03:17+00:00

I have the following code. The intent is to have this utility class that

  • 0

I have the following code. The intent is to have this utility class that I use to hold all my database work and just return populated ADODB.RecordSet objects. I am getting errors. What am I doing wrong?

Public Property Get RecordSetCustomers() As ADODB.Recordset
    m_myDB.BuildConfig
    Dim cmd As New ADODB.Command
    Dim strSQL As String
    strSQL = "SELECT * FROM vw_customers"

    cmd.CommandType = ADODB.CommandTypeEnum.adCmdText
    cmd.ActiveConnection = m_myDB.DbConnection
    cmd.CommandText = strSQL

    Dim rs As New ADODB.Recordset
    Set rs = New ADODB.Recordset
    Set rs = cmd.Execute

    RecordSetCustomers = rs
End Property

The m_myDB is an object/class that holds all my database configuration/connection params.

The error I am receiving is: ‘Compile Error: Invalid use of property’

I tried converting this to a function with same result.

  • 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-05-29T21:03:20+00:00Added an answer on May 29, 2026 at 9:03 pm

    VBA syntax requires the keyword ‘set’ for object reference assignments. See http://roymacleanvba.wordpress.com/2009/05/08/set-keyword/

        ...
        Set RecordSetCustomers = rs 
        End property
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code snippet that i use to compile class at the run
If I have the following code: Intent intent = new Intent(this,DownloadService.class); for(int i=0;i<filesArray.length;i++){ startService(intent);
I have the following code in one activity: in= new Intent(ThisActivity.this,AnotherActivity.class); imgarr = new
I have following code that displays an Image with letters, public class MainActivity extends
I have the following code to tabhost. tabHost.addTab(tabHost.newTabSpec(tab1) .setIndicator(First Text) .setContent(new Intent(this, class1.class))); tabHost.addTab(tabHost.newTabSpec(tab2)
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public
I have following code class User attr_accessor :name end u = User.new u.name =
I have following code: public class readSensorsData extends Activity implements SensorListener { /** Called
I have created the alarm as shown below Intent intent = new Intent(this, Areceiver.class);
I have a main activity that launches a child activity using the following code:

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.