Thread: problem with "addnew" function.

  1. #1
    Registered User
    Join Date
    Dec 2001

    Unhappy problem with "addnew" function.

    i just recentelly opened my own website and i added a message board, the problem is that every time i'm using the "addnew" function of a reccordset, i'm getting the following error message:

    Microsoft JET Database Engine error '80040e09'
    Cannot update. Database or object is read-only.
    /eyalsite/post.asp, line 27

    i added the file "post.asp"(as post.txt) so you could have a look at it too.
    you could also see it for yourselfs at my site:
    (just get in the message board and try to post a new message).
    thanks in advance,

  2. #2
    Registered /usr
    Join Date
    Aug 2001
    Newport, South Wales, UK


    Funny-looking C/C++/C# code...

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Originally posted by SMurf
    Funny-looking C/C++/C# code...
    Pretty much!!! might want to look at your error message as it almost certainly gives the answer

    Database or object is read-only
    You cant add to a recordset for a readonly database...even if you are asking for a static cursor as you are

    Also add Close calls to your Recordsets when you no longer need them

  4. #4
    Use SQL statements, They are far faster.

    conn.Execute("INSERT INTO Messages (ForumID, PostedBy,....) VALUES(" & Request ("ForumID") & ",'" & Request("PostedBy") & "'," & ...
    conn.Execute("UPDATE Forums SET Posts = Posts + 1, LastPost= Now() WHERE ForumID = " & Request("ForumID") )
    Note: Text values should be surrounded with single quotes.

    Info on JET SQL:

    Otherwise, I think that you may have to set the cursor location to adUseClient before opening a static recordset that you want to update. (Very not sure).
    rs.cursorLocation = adUseClient

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. doubt in c parser coding
    By akshara.sinha in forum C Programming
    Replies: 4
    Last Post: 12-23-2007, 01:49 PM
  2. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  3. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  4. Problem with function pointers
    By vNvNation in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2004, 06:49 AM
  5. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 07:18 AM