This tutorial preserves the original Classic ASP + Microsoft Access ADO example because it is still useful when maintaining older sites. For new server-side applications, prefer a server database such as SQL Server rather than designing a new web application around an Access .mdb/.accdb file.
Set objconn = Server.CreateObject("ADODB.Connection")
objconn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & _
Server.MapPath("db/months.mdb")
objconn.Open
Server.MapPath() converts the site-relative database path into a physical server path. Keep writable Access database files outside publicly downloadable folders and grant only the IIS identity permissions the application actually needs.
Set objRs = Server.CreateObject("ADODB.Recordset")
A Recordset represents the rows returned by a table or query. For read-only listing pages, prefer the simplest forward-only/read-only behavior that meets the page's needs.
Recordset.Open Source, Connection, cursortype, locktype, commandtype
The Source may be a table, SQL statement or command; the selected cursor and lock types determine which navigation and update features are available.
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.