MyTetra Share
Делитесь знаниями!
OpenDataBase
16.03.2019
23:43
Текстовые метки: VBA, ADO, OpenDataBase, accdb
Раздел: !Закладки - VBA - Access - ADO

Dim db As Object Dim engine As Object

Set engine = CreateObject("DAO.DBEngine.120")

Set db = engine.OpenDatabase("C:\your\database.accdb")

Dim sql As String

sql = "UPDATE AccTable AS acc " & _ " INNER JOIN (SELECT * FROM [NamedRange] IN ""C:\your\excel\file.xlsx"" ""Excel 12.0 xml;"" ) AS xls " & _ " ON acc.ID = xls.ID " & _ " Set acc.SomeField = xls.SomeField "


db.Execute sql

 
MyTetra Share v.0.52
Яндекс индекс цитирования