Inventor 22 VBA DB Connection not working

Inventor 22 VBA DB Connection not working

felix_le
Explorer Explorer
743 Views
4 Replies
Message 1 of 5

Inventor 22 VBA DB Connection not working

felix_le
Explorer
Explorer

I am trying to create a DB connection in VBA in Inventor 2022 to a mysql server.

The same code works in Inventor 2021.

 

I get following error message (in german, translation below the image), Error happens at the line : "conn.Open ..."

felixlerchnerXDX47_0-1634621381792.png

 

 

Runtime error 'number ...'

Due to system error 127: The specified procedure was not found, (for path see image above) the specified driver could not be loaded.

 

 

 

I've reduced my code to the absolut minimum for simplicity:

 

 

Sub DB_()
    Dim conn As Object
    Set conn = CreateObject("ADODB.Connection")
   
    conn.Open "Driver={MySQL ODBC 8.0 UNICODE Driver};Server=SERVERADDRESS;Database=DBNAME;User=INSERTUSERNAME;Password=INSERTPASSWORD;Option=3;"
End Sub

 

 

As already said the same code works in Inventor 2021 -> connectionstring is working. (I've also tried with inserting the connection data into the windows "ODBC Data Sources" which also works in Inventor 2021 but not in Inventor 2022)

Reference are set right as far as i know, at least they work in Inventor 2021:

felixlerchnerXDX47_1-1634621985241.png

 

I've already tried it on two Win10 PCs both running 10.0.19034

If there is any information I can add or steps for further troubleshooting, please let me know.

 

0 Likes
744 Views
4 Replies
Replies (4)
Message 2 of 5

bshbsh
Collaborator
Collaborator

Hi,

have you ever solved this?

I am doing this since years and it has worked (and it still is), but this error occured randomly. But since we're using Vault, this happens very often, I'd say, almost always...

0 Likes
Message 3 of 5

marcin_otręba
Advisor
Advisor

hi, i am using it since years as well with vault since 2013 and i do not have any issues... this is how my connection code looks like:

constring = "my conn string"


Dim con As ADODB.Connection
Dim cmd As ADODB.Command
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
On Error GoTo Err_semail
Set con = New ADODB.Connection
con.ConnectionString = constring

con.Open

 

Hi, maybe you want to vote my:

Ideas

or check my apps:

DrawingTools   View&ColoringTools   MRUFolders   auto-save-replace

0 Likes
Message 4 of 5

bshbsh
Collaborator
Collaborator

It works for us as well. Except it sometimes errors out with the above message, while working... It's not the connection. It connects fine. It's something with either Inventor or maybe Windows (if we believe the error message saying the driver could not be loaded... Why? it was already loaded and working... Maybe windows does something in the background that temporarily prevents the driver to be used? Dunno.

We need to restart inventor and then it connects and works again.

0 Likes
Message 5 of 5

marcin_otręba
Advisor
Advisor

maybe you want to connect again befere you close existing connection ?

Hi, maybe you want to vote my:

Ideas

or check my apps:

DrawingTools   View&ColoringTools   MRUFolders   auto-save-replace

0 Likes