problem with "addnew" function.

This is a discussion on problem with "addnew" function. within the Windows Programming forums, part of the Platform Specific Boards category; i just recentelly opened my own website and i added a message board, the problem is that every time i'm ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    3

    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:
    http://www33.brinkster.com/eyalsite
    (just get in the message board and try to post a new message).
    thanks in advance,
    Attached Files Attached Files

  2. #2
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,266

    Exclamation

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

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Originally posted by SMurf
    Funny-looking C/C++/C# code...
    Pretty much!!!


    Anyway....you 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
    fou
    Guest
    Use SQL statements, They are far faster.

    Code:
    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:
    http://www.devguru.com/Technologies/..._sql_list.html

    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, 11:03 AM
  4. Problem with function pointers
    By vNvNation in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2004, 07:49 AM
  5. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 07:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21