79232137

Date: 2024-11-27 23:16:00
Score: 0.5
Natty:
Report link

Finally, I found 2 solutions.

  1. 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

  1. 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

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: h2oyes ss