Hello I am new to ASP and Access Databases really as well. I primarily use PHP and MySQL/Postgre.I work for my university in web admin department and due to rather sloppy coding in the past by workers have to rewrite an ASP form that writes to an Access DB. I have a rather large application form in which I need to be able to have insert the info into a database.If someone could perhaps post code to get me started (connection to database, inserting example data etc.), i can probably figure it out from there. I've googled around and came up with a mess of code possibilities, none I've been able to edit into any working code for this scenario. Thanks ahead.
- Jesse Kemper

Dani AI

Generated

Short summary and focused next steps for (building on ’s note that this is usually a permissions problem).

A simple INSERT that returns "Operation must use an updateable query" almost always means the IIS worker cannot create/update files in the folder that holds the .mdb (Access creates a .ldb/.laccdb lock file in the same folder). Before changing SQL or ASP, verify the file/folder permissions and the app pool identity. (learn.microsoft.com)

What to check and how to fix it

  • Confirm which Windows identity your site runs under (IIS Manager → Application Pools → select the pool → Advanced Settings → Identity). On modern IIS the identity is usually a virtual account (IIS APPPOOL\<AppPoolName>). (learn.microsoft.com)
  • Grant that identity Modify (read/write/create/delete) permission on the folder that contains the .mdb (not just the .mdb file) so Access can create/delete the lock file. For testing you can temporarily give Everyone modify rights, but revert to the app-pool account or IIS_IUSRS for production. Microsoft docs show the ApplicationPoolIdentity workflow. (learn.microsoft.com)

Recommended connection and safer insert pattern

  • Use the Jet/ACE OLEDB provider (server-side) rather than the desktop "Access Driver" DSN approach, and use parameterized ADO Command objects to avoid quoting/SQL-injection issues. (stackoverflow.com)

Example (classic ASP sketch — adjust names/lengths):

' open with Provider=Microsoft.Jet.OLEDB.4.0 (or ACE for .accdb)
' use ADODB.Command with ? parameters and cmd.CreateParameter(...)

Quick troubleshooting checklist

  • Ensure folder and file are not marked Read‑Only; DB isn’t opened exclusively by another user; DB is on a local drive (or proper share permissions exist); try a small test ASP that creates a file in that folder to confirm write access. If problems persist, compact/repair the .mdb. (learn.microsoft.com)

If those steps are done and it still fails, post the app-pool identity and exact permission settings and a sanitized version of the connection string (don’t paste passwords) and someone can point to the next step.

Pardon my lack of ASP knowledge if Im wayyyy off. But the below code i believe should work. I get an error though. The code and error are below. From what i understand (via google) perhaps the file needs permissions?

<%
	'Setup my dnsless connection
set conn = server.createobject("adodb.connection")
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "DBQ=" & server.mappath("ga_jobdesc_form.mdb")
conn.Open DSNtemp

'Add Data to database
SQLstmt="INSERT INTO Results(Year1,filler_first_name,filler_last_name)"
SQLstmt = SQLstmt & " VALUES ('" & request.form("AcademicYear") & "','" & request.form("filler_first_name") & "','" & request.form("filler_last_name") & "')"
conn.execute(SQLstmt)
conn.close
set conn = nothing
set sqlstmt = nothing 
%>
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.

That error usually means a permissions problem, and that the Access database needs to have read/write permissions set for Everyone.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.