I have written (actually pirated, lol) some code that works very nicely to create new Access table records from Excel sheet, as long as the Accdb is closed. Else I get a "file already in use" error.
Can i update the table using a different methodology?
Do i just need to split the db? (so that the Excel vba can write to the "back end" file?)
fwiw, here's my existing code:
Code:
'Open the connection.
con.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & accessFile
'Create the SQL statement to retrieve the data
sql = "SELECT * FROM " & accessTable
'Create the ADODB recordset object.
Set rs = CreateObject("ADODB.Recordset")
'Set the necessary recordset properties.
rs.CursorType = 1 'adOpenKeyset on early binding
rs.LockType = 3 'adLockOptimistic on early binding
'Open the recordset.
rs.Open sql, con