The code given above is ASP (for web pages) but you can use ADO in access.
You need to set the reference to Microsoft ActiveX Data Objects in the references section from a code module. Open a module, go to tools references and set the reference as shown in the attached image.