MyTetra Share
Делитесь знаниями!
Время создания: 11.10.2019 13:04
Текстовые метки: VBA, DAO, OpenDataBase
Раздел: !Закладки - VBA - Access - DAO

'==================================================================================

'\\Открытие бызы данных

'---------------------------------------------------------------------------------------

Function funOpenDatabaseDAO(ByVal strPathDb As String) As DAO.Database

Dim engine As Object ',db As Object

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

Set funOpenDatabaseDAO = engine.OpenDatabase(strPathDb)

End Function

'==================================================================================


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.53
Яндекс индекс цитирования