I am trying to insert ms access table into Oracle table using the below code. I get an error "table or view does not exist" at cn.Execute strSql line. I think the code is unable to identify the access table name. Any help is greatly appreciated. Thanks!
Function test()
Dim cn As New ADODB.Connection
Dim rs As DAO.Recordset
Dim strSql As String
Dim db As DAO.Database
Dim ssqlFields As String
Dim i As Integer
Dim ssql As String
Set db = CurrentDb
Set cn = New ADODB.Connection
Set rs = db.OpenRecordset("SELECT * FROM T_556_557_ORCL", dbOpenDynaset)
cn.Open ( _
"User ID = XXXX" & _
";Password=YYYY" & _
";Data Source=ABCD" & _
";Provider=OraOLEDB.Oracle")
cn.CommandTimeout = 300
strSql = "INSERT INTO TDMTRDOP.TEST SELECT Ent_Ex_Summ,QTY FROM T_556_557_ORCL"
cn.Execute strSql
Set rs = Nothing
Set cn = Nothing
End Function