I am doing screen scraping from Reflections and have typically sent the output to Excel and never had a problem. I am now trying to write to Access. Like many of the other threads, I am getting a runtime error 462 every other time I run this code. In trying to solve the problem, I have commented out all code pertaining to recordsets and basically have left the macro as opening and closing and I still get the error. I must be missing something and not closing all references to Access.
Can anyone see something I am missing? Thank you.
You don't know what you don't know...
Can anyone see something I am missing? Thank you.
Code:
Sub UpdateTest()
Dim rs As DAO.Recordset
Dim db As DAO.Database
Dim ws As DAO.Workspace
dbPath = "S:\Pharmacy General\Databases Automation\Databases\Test\Test.accdb"
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase(dbPath)
Set rs = db.OpenRecordset("tblRPHITemp", dbOpenDynaset)
....processing code
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
ws.Close
Set ws = Nothing
Access.Application.Quit
End Sub
You don't know what you don't know...