cheekynorton
Technical User
Hi, Im new to asp and need some help badly.
Below is the code used for an asp page used to add a new record to the database
<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include virtual="/adovbs.inc"-->
<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & _ "DBQ=C:\inetpub\objConn.Open
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset"
objRS.Open "details", objConn, , adLockOptimistic
objRS.AddNew
objRS("Name"
= Request.Form("Name"
objRS.Update
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
<HTML>
<BODY>
Thankyou for choosing to stay with us.
</BODY>
</HTML>
When entering a value on the form (ive not included the html for the form page) and clicking the submit button the following error appears :-
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/Database/registeruser.asp, line 16
the error keeps referring to the objRS.Update line.
Can anyone guide me? Is the code wrong? Can anyone recommend any useful websites?
Many thanks for your help!
Adrian
Below is the code used for an asp page used to add a new record to the database
<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include virtual="/adovbs.inc"-->
<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & _ "DBQ=C:\inetpub\objConn.Open
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset"
objRS.Open "details", objConn, , adLockOptimistic
objRS.AddNew
objRS("Name"
objRS.Update
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
<HTML>
<BODY>
Thankyou for choosing to stay with us.
</BODY>
</HTML>
When entering a value on the form (ive not included the html for the form page) and clicking the submit button the following error appears :-
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/Database/registeruser.asp, line 16
the error keeps referring to the objRS.Update line.
Can anyone guide me? Is the code wrong? Can anyone recommend any useful websites?
Many thanks for your help!
Adrian