Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Error Type:
Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query.
/9710/reg_insert.asp, line 46

Form Code:
XML
<html>
<head>
<title>Registration</title>
</head>
<body>
<form name="frmInsert" method="post" action="reg_insert.asp"> <input type="hidden" name="insrow" value="1">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="1">
<tr>
<td width="50%" height="1"> Enter ur First Name
</td>
<td width="50%" height="1"><input type="text" name="fname" size="20"></td>
</tr>
<tr>
<td width="50%" height="1"> Enter ur Last Name
</td>
<td width="50%" height="1"><input type="text" name="lname" size="20"></td>
</tr>
<tr>
<td width="100%" height="1" colspan="2">
<input type="submit" value="Submit" name="B1" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
</tr>
<tr>
<td width="100%" height="1" colspan="2">
<input type="reset" value="Reset" name="B2"></td>
</tr>
</table>
</form>
<%
Dim Conn
Dim Sqlstmt
Dim fn
Dim ln

response.write("fname =" & fn)
response.write("lname =" & ln)

If request("insrow") = "1" THEN
 fn = request("fname")
 ln = request("lname")

 Set Conn = Server.CreateObject("ADODB.Connection")
Conn.connectionstring ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("reg1.mdb")& ";"
Conn.Open

<big>SQLstmt = "INSERT INTO flname (fname,lname) VALUES ('" & fn & "','" & ln & "')"
Conn.execute(SQLstmt)</big>
Conn.Close
Set Conn = Nothing
response.write("<p>done inserting row</p>")
End If
%>

</body>
</html>
Posted
Updated 14-Jul-10 20:44pm
v3
Comments
Christian Graus 15-Jul-10 2:19am    
Wow - I forgot how ugly ASP was. Why are you still using it ? It's possible to add new pages to an ASP site using ASP.NET.
Sandeep Mewara 15-Jul-10 2:26am    
And which line here is line 46?
J a a n s 15-Jul-10 3:10am    
Do IIS user account have enough permission (write/modify access) to the file?

1 solution

Check support pages

http://support.microsoft.com/kb/175168[^]

"The most common reason is that the Internet Guest account (IUSR_MACHINE), which is by default part of the "Everyone" group, does not have Write permissions on the database file (.mdb). To fix this problem, use the Security tab in Explorer to adjust the properties for this file so that the Internet Guest account has the correct permissions."

So, check that your Internet guest account has write permissions to your Access database located at Server.MapPath("reg1.mdb")

If that is not the issue, Work through the other possible resolutions in the article
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900