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

  • SEARCH
  • Home
  • 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 306951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:30:50+00:00 2026-05-12T07:30:50+00:00

I have an OLE DB connection in VB.NET that I am trying to use

  • 0

I have an OLE DB connection in VB.NET that I am trying to use to connect to an Oracle database. However, I get the following error on the con.Open() line:

LoaderLock was detected

Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.

Here is my code:

Dim con As New OleDb.OleDbConnection

ConfigConnection()

Try
    con.ConnectionString = ConnectionString
Catch ex As Exception
    MsgBox("Invalid connection string)
    Return
End Try

Try
    con.Open()
    MsgBox("Connection attempt successfull!")
Catch ex As Exception
    MsgBox("Unable to connect to data source.")
End Try

I use this same code to connect to various other types of databases, including SQL Server, Excel, and Access. When connecting to any of those it connects successfully and I don’t get this error.

I am executing this code within a dll. If I execute it within an exe it works fine. However, I need to execute this within this dll.

  • 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-12T07:30:51+00:00Added an answer on May 12, 2026 at 7:30 am

    It’s a debugger assistant warning, so if you test your code and find it works fine, you may not need to worry about it.

    I’ve seen a similar thing when calling DirectX, but following all the suggestions on the net to eliminate the error made no difference – the code you’re calling still does whatever naughty thing it shouldn’t be doing. Having put in a lot of effort trying to eliminate it, and yet not seen a single problem caused by it after 2 years, I filed it in my “just ignore this irritating warning” bin.

    You can suppress the warning by going to Debug -> Exceptions. Click the Find button and type LoaderLock, then untick it.

    BUT this advice only applies IF you have thoroughly tested your application and are absolutely sure that the application never fails because of the LoaderLock. And then it’s at your discretion as to whether you are happy to release your program with this potential problem in it.

    Perhaps somebody else will be able to supply a better solution though – I always feel rather uneasy about ignoring this type of warning.

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

Sidebar

Related Questions

I have the following Access 2002 query I'm running through OLE DB in .NET:
I have an OLE DB Command component in an SSIS Package that runs an
I have the following code to open a browser in Perl $IE = Win32::OLE->new(InternetExplorer.Application);
I have to use OLE DB with an SQL Server CE. My task is
Well I have a simple MS Access database where the connection is fine but
I have a ASP.NET application running on Windows 2003 that needs to communicate with
I am currently working on a VB.NET desktop application that uses .mdb (Access) database
I have written a Windows Forms application in C#, .NET framework 2.0, that uses
I have a very funny problem on my application, I get an error as
I have a SQL Server 2008-R2 database that has a table that is storing

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.