I'm trying to access a database which i can do the problem is when I go to add a new record here is the error i get and then the code
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services
--------------------------------------------------------------------------------
Technical Information (for support personnel)
Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/maria/scripts/added_message.asp, line 55
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Page:
POST 135 bytes to /maria/scripts/added_message.asp
POST Data:
txtName=maria&txtClass=EET400&txtSection=01&txtStart=02%2F18%2F2003&txtEnd=02%2F28%2F2003&txtScrMessage=this+is+a+test&cmdSubmit=Submit
------------------------------------------------
here is the code
Language = "VBScript"
#include file="adovbs.inc"
dim conn
dim rsMessage
dim sSQL
dim sStartDate
dim sEndDate
dim sClass
dim sSection
dim sMessage
dim sUserID
'Initialize an ActiveX Data Object Database connection (ADODB).
set conn = server.createobject("adodb.connection")
'Checks to see if the variable conn was created as an object.
if isObject(conn) then
'Open the database using the Microsoft Jet Engine.
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & server.mappath("../DBMS/EAS.mdb") & ";" & _
"User Id=admin;Password="
else
response.write("Object was not created")
response.redirect "../create_message.asp"
end if
set rsMessage = server.createobject("adodb.recordset")
'Checks to see if the variable rsMessage was created as an object.
if isObject(rsMessage) then
'Open the Messages table in the EAS.mdb database.
rsMessage.LockType = 3
rsMessage.CursorType = 1
rsMessage.open "Messages", conn
else
response.write("Object was not created")
response.redirect "../create_message.asp"
end if
sStartDate = request.form("txtStart")
sEndDate = request.form("txtEnd")
sClass = request.form("txtClass")
sSection = request.form("txtSection")
sMessage = request.form("txtScrMessage")
sUserID = session("instructor")
rsMessage.AddNew '<----- HERE IS WHERE THE ERROR IS OCCURING.
rsMessage("txtStart") = sStartDate
rsMessage("txtEnd") = sEndDate
rsMessage("txtClass") = sClass
rsMessage("txtSection") = sSection
rsMessage("txtScrMessage") = sMessage
rsMessage("UserID") = sUserID
rsMessage.Update
Please help and thanks in advance.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only