Results 1 to 2 of 2

Thread: Can't add a new record to a table!help me

  1. #1
    sunmoon Guest

    Can't add a new record to a table!help me

    I am a new learner,could you help me?
    I want to add a record to the table,but couldn't.
    when I run it,it said:


    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC Microsoft Access 97 Driver] Can't update. Database or object is read-only.

    /goverment/test1.asp, line 17


    This my asp file:
    <html>
    <!--#include virtual=&#34;/ASPSAMP/SAMPLES/ADOVBS.INC&#34;-->

    <head>
    <title>dbnewrec.asp</title>
    </head>

    <body bgcolor=&#34;#FFFFFF&#34;>
    <%
    conn=&#34;DSN=goverment;uid=gov;pwd=gov&#34;
    Set RS = Server.CreateObject(&#34;ADODB.Recordset&#34
    RS.Open &#34;year&#34;,Conn,3,3
    RS.AddNew
    RS(&#34;year&#34=&#34;1998&#34;
    &#39;RS(&#34;Author&#34 = auname
    &#39;RS(&#34;Year_Born&#34= int(auyear)
    RS.Update



    RS.Close
    Set rs=nothing

    %>
    </body>
    </html>

  2. #2
    John Guest

    Can't add a new record to a table!help me (reply)

    Hi sunmoon,

    Sounds like your database is read-only. This is due to one of three things:

    1) Problem: Your .MDB file is read only.
    Solution: Go to the explorer, right-click on the .MDB file, choose
    properties and turn OFF the read-only flag (and system or hidden too!)

    2) Problem: Your DSN has the read-only attribute set.
    Solution: Go to Control Panel, ODBC, System DSN, click on the DSN then
    click Configure. Click Options and turn OFF the read-only checkbox.

    3) Problem: You registered the ASP-db DLL under MTS, and the ID you are
    using to access it with only has READ ONLY priviledges to the directory
    or file you&#39;re trying to open.
    Solution: Open up the Internet Information Server / Microsoft Transaction
    Server and change the ID for the package that contains ASP-db to an
    Admin level ID, or else, go to the explorer and give the ID mentioned
    above, full rights to the MDB file.

    Hope this helps!
    John



    On 12/22/98 2:38:31 AM, sunmoon wrote:
    > I am a new learner,could you help me?
    I want to add a record to the
    > table,but couldn&#39;t.
    when I run it,it said:


    Microsoft OLE DB
    > Provider for ODBC Drivers error &#39;80004005&#39;

    [Microsoft][ODBC
    > Microsoft Access 97 Driver] Can&#39;t update. Database or object is
    > read-only.

    /goverment/test1.asp, line 17


    This my asp
    > file:
    <html>
    <!--#include
    > virtual=&#34;/ASPSAMP/SAMPLES/ADOVBS.INC&#34;-->

    <head>
    <title>dbnewrec.
    > asp</title>
    </head>

    <body
    > bgcolor=&#34;#FFFFFF&#34;>
    <%
    conn=&#34;DSN=goverment;uid=gov;pwd=gov&#34;
    >
    Set RS = Server.CreateObject(&#34;ADODB.Recordset&#34
    RS.Open
    > &#34;year&#34;,Conn,3,3
    RS.AddNew
    RS(&#34;year&#34=&#34;1998&#34;
    &#39;
    > RS(&#34;Author&#34 = auname
    &#39;RS(&#34;Year_Born&#34=
    > int(auyear)
    RS.Update



    RS.Close
    Set rs=nothing

    %>
    </body>
    </html>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •