S
Sanju
I keep getting this error whenever I run my ASP page
Error Type:
Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query.
/usergroup/addtodbase.asp, line 37
I've searched about this error in the internet but I can't find the answer.
I hope somebody can help me in here...
<% @ Language="VBScript" %>
<% Option Explicit %>
<html>
<head>
<title>Form to database</title>
</head>
<body>
<%
'declare your variables
Dim name, staffno, comments
Dim sConnString, connection, sSQL
' Receiving values from Form, assign the values entered to variables
name = Request.Form("name")
staffno = Request.Form("staffno")
comments =Request.Form("comments")
'declare SQL statement that will query the database
sSQL = "INSERT into tbluserdbase (name, staffno, comments) values ('" & _
name & "', '" & staffno & "', '" & comments & "')"
'define the connection string, specify database
'driver and the location of database
sConnString= "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = " & Server.MapPath("userdatabase.mdb")
'create an ADO connection object
Set connection = Server.CreateObject("ADODB.Connection")
'Open the connection to the database
connection.Open(sConnString)
'execute the SQL
connection.execute(sSQL)
response.write "The form information was inserted successfully."
' Done. Close the connection object
connection.Close
Set connection = Nothing
%>
</body>
</html>
Thanks in advance and have a nice day!
Error Type:
Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query.
/usergroup/addtodbase.asp, line 37
I've searched about this error in the internet but I can't find the answer.
I hope somebody can help me in here...
<% @ Language="VBScript" %>
<% Option Explicit %>
<html>
<head>
<title>Form to database</title>
</head>
<body>
<%
'declare your variables
Dim name, staffno, comments
Dim sConnString, connection, sSQL
' Receiving values from Form, assign the values entered to variables
name = Request.Form("name")
staffno = Request.Form("staffno")
comments =Request.Form("comments")
'declare SQL statement that will query the database
sSQL = "INSERT into tbluserdbase (name, staffno, comments) values ('" & _
name & "', '" & staffno & "', '" & comments & "')"
'define the connection string, specify database
'driver and the location of database
sConnString= "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = " & Server.MapPath("userdatabase.mdb")
'create an ADO connection object
Set connection = Server.CreateObject("ADODB.Connection")
'Open the connection to the database
connection.Open(sConnString)
'execute the SQL
connection.execute(sSQL)
response.write "The form information was inserted successfully."
' Done. Close the connection object
connection.Close
Set connection = Nothing
%>
</body>
</html>
Thanks in advance and have a nice day!