MySQL Forums
Forum List  »  Connector/ODBC

Automation error message
Posted by: Jean THIPHAVONG
Date: January 29, 2020 09:14AM

Hi, Since 6 weeks, I couldn't run anymore VBA command rs.update without error message "Run-time error '-2147217887 (80040e21)': Automation error".

I use Mysql Connector/ODBC 8.0 for VBA. I run a VBA program running in EXCEl that compares Mysql Database and SQL Database. Every change found on Mysql Database is automatically changed by the command rs.update from ADO.

Here is a sample of my VBA program concerning only Mysql connection and update command.
Dim IDNumber As Integer
Dim OSNumber As Integer

Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim fld As ADODB.Field
Dim sql As String
Dim SqlSelect As String

Set conn = New ADODB.Connection
conn.Open "DRIVER={MySQL ODBC 8.0 Unicode Driver};" _
& "SERVER=GDC1PGLP******;" _
& " DATABASE=inventory;" _
& "User=***;Password=*****; OPTION=3"

Set rs = New ADODB.Recordset
rs.CursorLocation = adUseServer

OSNumber =0
IDNumber = Worksheets("GLPI_MEA").Cells(j, 1).Value
SqlSelect = "select * from glpi_computers where id=" + Str(IDNumber)
rs.Open SqlSelect, conn, adOpenDynamic, adLockOptimistic
rs!operatingsystems_id = OSNumber

Each time I ran the program, it stops at the line rs.update with an error message: "Run-time error '-2147217887 (80040e21)': Automation error"

You have to know, that everything was working fine 2 months ago without issue. The VBA program was run properly.
When I decide to run the VBA program again this month, the error message appears.

I didn't make any changes to the program. and I have the error message.
I look into the internet but didn't find a resolution concerning this error message.

I need your help with this because, at this time, I am stuck...

Many thanks to anyone who can help me.

Options: ReplyQuote

Written By
Automation error message
January 29, 2020 09:14AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.