Finally, I found 2 solutions.
- use Provider OLEDB 12 or OLEDB 16
Note: I found that CurrentProject.AccessConnection use OLEDB 10 Provider
Private Sub test1()
Dim rs As New ADODB.Recordset
Dim size As LongLong
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.ACE.OLEDB.16.0;Data Source=d:\data\Make Money\Rapidgator\Rapidgator.accdb;Persist Security Info=False;"
rs.Open "Select * From LocalFiles ", _
cn, adOpenKeyset, adLockOptimistic
rs.AddNew
size = 12345678912345#
rs("FileSize") = size
rs.Update
rs.Close
cn.Close
End Sub
- Use ADODB
Private Sub test2()
Dim size As LongLong
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("Select * From LocalFiles ", dbOpenDynaset)
size = 12345678912345#
rst.AddNew
rst("Size1") = size
rst.Update
rst.Close
End Sub