We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

referencing dll not in system32

Medium Priority
340 Views
Last Modified: 2012-05-07
I want to refrencing the dll not from system32 but from c:\mydir

this is my real code and the dll is myodbc3.dll:

 

Option Explicit
Dim CONN As ADODB.Connection
Dim RS As ADODB.Recordset
Dim USERNAME As String
Dim PASSWD As String
Dim SERVERIP As String
Dim DB As String
Public Function connectMysql(USERNAME As String, PASSWD As String, SERVERIP As String, DB As String, CONN As ADODB.Connection, RS As ADODB.Recordset)
 
Set CONN = New ADODB.Connection
Set RS = New ADODB.Recordset
PASSWD = "aaaa"
 
CONN.CursorLocation = adUseClient
 
CONN.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=" & SERVERIP & ";UID=" & USERNAME & ";PWD=" & PASSWD & ";DATABASE=" & DB & ";" _
& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 163841
CONN.Open
 
End Function
Sub uno()
Call connectMysql("root", "", "xxxxxxxxxx", "TEST", CONN, RS)
End Sub

Open in new window

Comment
Watch Question

CERTIFIED EXPERT

Commented:
Either the dll needs to be an Active X DLL...
  if so, then when the dll is registered, the location of the DLL will be recorded in the registry...

Or the dll needs to be located in a folder that is included in the Environment Variables/System Variable "PATH" (or update your "PATH" system environment variable to include "C:\MyDir".

Under XP, you will find PATH in ...
Settings, Control Panel, System Properties, Advanced Tab, Environment Variables Button.  Path is specifically in the values in the lower section.  Once modified (by adding ";C:\MyDir" to the end of the existing Path") you might have to restart your computer.

Author

Commented:
Complicated for me....
In other case the original my prob is:

When i run the code on pc where is intalled "The Connector 3.5.1-MySql" all work fine an i connect the project with no prob...
The prob is when i run a code on pc where not is installed the "The Connector 3.5.1-MySql" have error not found provider ecc....

I think because the dll not is installed on pc of other user.

I dont want to install for each pc in my lan (45 pc)  "The Connector 3.5.1-MySql", sure!

If have other solution to connect mysql with the standard configuration of pc are welcome!
CERTIFIED EXPERT
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.