如何使用OLEDB VB脚本将MSAccess表数据插入到oracle表中?

时间:2018-10-19 18:59:53

标签: vba oledb ms-access-2016

我正在尝试使用OLEDB方法将MS Access表数据(SharePoint链接表)插入Oracle表中。我正在错误以下。 Ora00942-表或视图不存在。请帮助

Private Sub Command2_Click()
    Dim rs As ADODB.Recordset
    Dim cn As ADODB.Connection
    Set rs = New ADODB.Recordset
    Set cn = New ADODB.Connection

    cn.Open "Provider=OraOLEDB.Oracle;User ID=XX;Password=XX;Data Source=XX;"
    cn.CursorLocation = adUseClient

    Set rs = cn.Execute("INSERT INTO TBL_Oracle(NO,NAME)SELECT TBL_Access.NO, TBL_Access.NAME FROM TBL_Access")
    MsgBox "Oracle table updated"
    cn.Close
End Sub

0 个答案:

没有答案