Access - Update in table without using VBA module

Asked

Viewed 109 times

0

I need to update a table once a month, in which the entered data should be placed in the respective current month. I have been doing this via VBA code, however, as the table has approximately 30 thousand lines, the process is time consuming. I would like to carry out the process via Access Query. Has anyone faced the same problem? If not, there are ways to optimize this process via vba code ?

1 answer

1

Do you want to write the excel data in Access? If so below follows an example of a method that receives excel data as parameters(can be implemented in a looping) and inserts into Access.

Sub INSERT_EMAIL(protocolo, EMAIL)

    strConOracle = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\db.accdb" 
    Set oConOracle1 = CreateObject("ADODB.Connection")
    oConOracle1.Open strConOracle


    'On Error Resume Next
    oConOracle1.Execute ("INSERT INTO TABELA_ACCESS (PROTOCOLO,END_EMAIL) VALUES  (" & protocolo & " , """ & EMAIL & """ ) ")



    oConOracle1.Close
    Set oConOracle1 = Nothing


End Sub

Browser other questions tagged

You are not signed in. Login or sign up in order to post.