hovercraft
Technical User
I am having problems appending records from a local table (currentdb) to a mySQL table on a 3rd party web host. I have to connect using ADO and the myODBC driver 5.1 . Simply linking the table doesn't work as the web host has a connection time out set at 60 seconds and they won't change it.
I can connect and delete all the records from the remote mySQL table like this
if I replace strSql with ....
then I get a run time error # -2147217865 table mysqldatabase.myaccesstable doesn't exisit.
beacuase it's a local access table not part of the adoConn
Any idea's how I can use a local table in the strSql variable?
Thanks for this great community!
I can connect and delete all the records from the remote mySQL table like this
Code:
myodbcconn = "Driver={MySQL ODBC 5.1 Driver};Server=xx.xx.xxx.xx;Port=3306;Database=mydqldbname;User=myuser; Password=mypassword;Option=3;"
Dim adoConn As ADODB.Connection
Dim adoRS As ADODB.Recordset
Set adoConn = New ADODB.Connection
Set adoRS = New ADODB.Recordset
Dim strSql As String
strSql = "DELETE mysqltable.* FROM mysqltable;"
adoConn.Open myodbcconn
adoRS.Open strSql, adoConn
Set adoRS = Nothing
Set adoConn = Nothing
Set adoConn = Nothing
if I replace strSql with ....
Code:
strSql = "insert INTO mysqltable select * FROM myaccesstable;"
beacuase it's a local access table not part of the adoConn
Any idea's how I can use a local table in the strSql variable?
Thanks for this great community!