JumboCactuar
Well-known Member
- Joined
- Nov 16, 2016
- Messages
- 788
- Office Version
- 365
- Platform
- Windows
Hi,
First i will link my thread i posted on Reddit related to this which i never managed to resolve:
ADODB MYSQL - Can't create TCP/IP socket (10093)
I have some code which inserts data into a database, when i try use the code to insert into both (an access DB and MySQL DB) i get this error. (Can't create TCP/IP socket (10093)
I have tried using CNN for 1 and CNN2 for the other.
I have tried using Access first, and MYSQL first
Note: if i only use 1 or the other it is fine with no problems
as at first i thought was a firewall issue but using only MYSQL works ok
Example code:
appreciate any help
First i will link my thread i posted on Reddit related to this which i never managed to resolve:
ADODB MYSQL - Can't create TCP/IP socket (10093)
I have some code which inserts data into a database, when i try use the code to insert into both (an access DB and MySQL DB) i get this error. (Can't create TCP/IP socket (10093)
I have tried using CNN for 1 and CNN2 for the other.
I have tried using Access first, and MYSQL first
Note: if i only use 1 or the other it is fine with no problems
as at first i thought was a firewall issue but using only MYSQL works ok
Example code:
VBA Code:
Sub UploadData()
ADODBInsertACCESS
ADODBInsertMYSQL
End Sub
Sub ADODBInsertACCESS()
Set Cnn = New ADODB.Connection
Cnn.Open "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=xxx;"
I = 2
VBL2 = Sheet1.Cells(I, 2).Value
VBL3 = Sheet1.Cells(I, 3).Value
VBL4 = Sheet1.Cells(I, 4).Value
VBL5 = Sheet1.Cells(I, 5).Value
MYSQL = "INSERT INTO TABLE1 (COLUMN2,COLUMN3,COLUMN4,COLUMN5) VALUES ('" & VBL2 & "','" & VBL3 & "','" & VBL4 & "','" & VBL5 & "');"
Cnn.Execute MYSQL
Cnn.Close
Set Cnn = Nothing
End Sub
Sub ADODBInsertMYSQL()
Set Cnn = New ADODB.Connection
Cnn.Open "Driver={MySQL ODBC 5.1 Driver};SERVER=xxx;DATABASE=xxx;UID=xxx;PWD=xxx;PORT=xxx;"
I = 2
VBL2 = Sheet1.Cells(I, 2).Value
VBL3 = Sheet1.Cells(I, 3).Value
VBL4 = Sheet1.Cells(I, 4).Value
VBL5 = Sheet1.Cells(I, 5).Value
MYSQL = "INSERT INTO TABLE1 (COLUMN2,COLUMN3,COLUMN4,COLUMN5) VALUES ('" & VBL2 & "','" & VBL3 & "','" & VBL4 & "','" & VBL5 & "');"
Cnn.Execute MYSQL
Cnn.Close
Set Cnn = Nothing
End Sub
appreciate any help