PDA

View Full Version : Cant write to my DB


mobious
06-19-2003, 11:17 AM
Something has changed and for the life of me I cant figure out what it is.. I was able to update my DB with the following script but for some reason now I can not.. It comes back with this error

Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/work/management/admin/anewsupdate.asp, line 19


Here is the update script

<!--#INCLUDE file="../../includes/config.asp"-->
<%
DIM rsNews
DIM strSql
DIM strTitle, strSnews, strNews

strTitle = Request("title")
strSnews = Request("sNews")
strNews = Request("lNews")

Set rsNews = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT * FROM news;"

rsNews.CursorType = 2
rsNews.LockType = 3

rsNews.Open strSql, adocon

rsNews.AddNew
rsNews("newstitle") = Request("title")
rsNews("shortnews") = Request("sNews")
rsNews("news") = Request("lNews")
rsNews.Update
rsNews.Close
adocon.Close

Response.Redirect("Index.asp?nav=maint")

%>

Thanks for the help in advance..

:)

Angelika
06-19-2003, 11:25 AM
try this:

Set rsNews = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT * FROM news"
rsNews.Open strSql, adocon,3,3

mobious
06-19-2003, 11:35 AM
Nope still getting that same error... Ohh BTW I havent messed with the IIS settings..

Kodo
06-19-2003, 01:19 PM
you need to check the file permissions on the database itself. Right click on the file, click on properties, then security tab. Add IUSR_machinename (where machine name is the name of your server) and give that user modify rights. DO NOT give full rights..

Apply it and hit ok.. all done. :D

mobious
06-19-2003, 01:56 PM
That was already in there..

Kodo
06-19-2003, 01:57 PM
ok. make sure that the file is not set to read only. Right click , properties.. look on the bottom for file attributes.. make sure read only box is not checked.

mobious
06-19-2003, 02:05 PM
Nope it is not read only...

Ohh man this is bugging me.. Im trying to figure out what I did to change this..
I can still enter data in if I open up the DB. but not from a webpage..

errrrrrr:cry:

mobious
06-19-2003, 02:13 PM
Figured it out..

I remembered what I did.. Last week I edited my Global.asa file to remove some DB entries that I was no longer using.. I removed the wrong one..

Opps..:eek:

Thanks for the help though!