Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dll error

Status
Not open for further replies.

sjulian

Programmer
Aug 15, 2000
56
US
I have been given a dll by a trusted business partner and am trying to use it in a vb 2010 application I am writing.
When I run the app in the IDE debug mode I get the error: “Unable to find an entry point named 'OpenDBConnection' in DLL 'c:\ims\mtcomponents\mtexecutedbchanges.dll'"
I get the same error for all three functions except with the appropriate entry point name; I understand that the ExecuteQuery and CloseDBConnection functions would error if the Open function did not execute, but I believe they would return a different error than the entry point one.
I want to determine if the problem is with my code or with the dll as I am not very experienced at incorporating dlls into my code.
I have run regsvr32 on the dll and it registered ok.
Your assistance will be appreciated.
Code:
Public Class Form1
    Public Declare Function OpenDBConnection Lib "c:\ims\mtcomponents\mtexecutedbchanges.dll" _
         (ByVal strDSNName As String, ByVal strEngineName As String, ByVal strDatabaseName As String) _
          As Boolean
    Public Declare Function ExecuteQuery Lib "c:\ims\mtcomponents\mtexecutedbchanges.dll" _
          (ByVal strSQL As String) As String
    Public Declare Function CloseDBConnection Lib "c:\ims\mtcomponents\mtexecutedbchanges.dll" () _
           As Boolean

    Private Sub cmdTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
           Handles cmdTest.Click
        Dim Results As String

        Dim bolDBOpen As Boolean = Opendbconnection("dialysistest", "dialysistest", "dialysistest")
        Results = ExecuteQuery("SELECT * FROM dba.patient_master")
        Dim bolDBclosed As Boolean = CloseDBConnection
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Label4.Text = ""
        Label2.Text = ""
    End Sub

    Private Sub cmdEnd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdEnd.Click
        End
    End Sub
End Class
 
Turned out an object needed to be instantiated.
Works fine after that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top