Updating Oracle Table from Excel VBA Macro using ODBC connection

前端 未结 2 1258
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-22 01:47

I have a sheet in Excel 2010 which pulls data in QueryTables from an Oracle database, connected via an ODBC DSN.

I need to take data from the spreadsheet and use it

2条回答
  •  情深已故
    2020-12-22 02:46

    Provider "MSDASQL" is Microsoft's OLE DB Provider for ODBC Drivers. It is quite old, and is now deprecated. It is really only for use with older databases for which there are no OLE DB providers. It is also 32-bit-Only, so it won't work with 64 bit providers (such as the one you are trying to use). You would be better off trying an OLE DB driver.

    The MS OLEDB provider for Oracle is "MSDAORA" (which should be pre-installed on your machine) and Oracle's own OLEDB provider is "OraOLEDB.Oracle". You would be best advised to download the latest Oracle-provided provider, as MSDAORA is also deprecated.

    You would need to download and install the Oracle provider (if you haven't already)

    .Provider = "OraOLEDB.Oracle"
    

    You would also need to set the .ConnectionString. Have a look at http://www.connectionstrings.com/oracle-provider-for-ole-db-oraoledb/ for some examples.

提交回复
热议问题