MyTetra Share
Делитесь знаниями!
Время создания: 11.10.2019 13:04
Текстовые метки: VBA, DAO, OpenDataBase
Раздел: Разные закладки - VBA - Access - DAO
Запись: xintrea/mytetra_db_adgaver_new/master/base/1538475057gtra888w5x/text.html на raw.githubusercontent.com

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

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

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

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