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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:15:37+00:00 2026-05-11T00:15:37+00:00

I’ve recently moved from VB6 to VB.NET and I am finally getting there with

  • 0

I’ve recently moved from VB6 to VB.NET and I am finally getting there with understanding the inner workings. I’ve been looking at my company’s existing codebase and I am a little suprised.

I understand that when VB.NET creates a string it see’s if the string is in memory and if not creates a new instance of that string, otherwise it points the new variable to the old . However I wonder if it does this with other objects?

The reason I ask is my new company has a DATABASE object which basically wraps database connection info and database connections in a object.

We also have a BOOK object and a PAGES object.

My best practice in VB6 would be to create a DATABASE object and then pass (byRef) that to the BOOK and then PAGES object, so you have one DATABASE object passed to muliple books and then PAGES.

However, how they have done it is to create a new instance of the DATABASE object in each PAGE and each PAGE object, which means you could have muliple instances (thousands in fact) of objects which are in fact all the same.

Is this wise? Or do objects get handled like Strings?

  • 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. 2026-05-11T00:15:37+00:00Added an answer on May 11, 2026 at 12:15 am

    Your understanding of strings is only applicable to string constants – not strings which are created in any other way.

    If the thousands of Database objects are all ‘the same’ then it sounds like they should actually be passing a reference to the same object around. You need to understand the difference between a reference and an object.

    Finally, nothing in your code should be holding onto connections, in all likelihood. It’s almost always better to open the connection, do whatever you need to, and then close it again. The connection pooling system can make sure that the real connection to the database (which is relatively expensive to create) is reused.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a bunch of posts stored in text files formatted in yaml/textile (from
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker
I have some data like this: 1 2 3 4 5 9 2 6

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.