Database Update Error

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Database Update Error

    I have a guestbook form that inserts the fields into an
    Access Database. The database is residing in the "fpdb"
    folder that was created by FrontPage. The ASP page that
    writes the data into the databse uses the
    "recordset.addnew" method. The code was working fine a
    couple of weeks ago, and now all of a sudden the error
    message "Cannot update.Database or object is read-only"
    pops up. The ASP code or the database was not changed or
    modified in any way, neither were the permissions for the
    account. Any ideas regarding this problem is truly
    appreciated? Thanks. Here are my connection strings:

    <%
    Dim connectionToDatabase,recordset
    set connection=Server.CreateObject("ADODB.Connection")
    set recordset=Server.CreateObject("ADODB.Recordset")

    connection.Open "Data
    Source=c:\Inetpub\wwwroot\xxxx\fpdb\addnewrecords. mdb" &_
    ";Provider=Microsoft.Jet.OLEDB.4.0;"


    recordset.Open "select * From Table", connection,1,2

    recordset.addnew

    recordset("socialsecurity")=request.form("ssnumber ")
    recordset("name")=request.form("name")
    recordset("age")=request.form("age")

    recordset.Update
    recordset.close
    set connection=nothing

    response.write "A new record had been added successfully to
    the database"

    %>

    ..
    tamimi Guest

  2. Similar Questions and Discussions

    1. Use a CFC to update a database with a date
      Hi All, I am trying to input a date in a database field with the current date. The datefield is in one table and I only want the date to be inserted...
    2. update database
      I have a database where I need to input values that I calculate. I only need to do this once, so I wanted to write a template to do this quickly. I...
    3. PHP and mySQL database update
      I am listing information from a mySQL DB and have edit buttons after each record. I want to be able to update what ever record by clicking the...
    4. Can a web service update a database ?
      Traditionally, examples of web service show them serving some data back to the clients. Can they update to a DB on the server too ?
    5. update from between database
      I have a Informix Database on Solaris and a SQL database. I need to update from Informix to SQL daily. Is there any easy way of doing it? BTW, I...
  3. #2

    Default Re: Database Update Error

    [url]http://www.aspfaq.com/5003[/url]

    Ray at work

    "tamimi" <tamimin1@scranton.edu> wrote in message
    news:0ce201c3be89$0c8e1160$a001280a@phx.gbl...
    > I have a guestbook form that inserts the fields into an
    > Access Database. The database is residing in the "fpdb"
    > folder that was created by FrontPage. The ASP page that
    > writes the data into the databse uses the
    > "recordset.addnew" method. The code was working fine a
    > couple of weeks ago, and now all of a sudden the error
    > message "Cannot update.Database or object is read-only"
    > pops up. The ASP code or the database was not changed or
    > modified in any way, neither were the permissions for the
    > account. Any ideas regarding this problem is truly
    > appreciated? Thanks. Here are my connection strings:
    >
    > <%
    > Dim connectionToDatabase,recordset
    > set connection=Server.CreateObject("ADODB.Connection")
    > set recordset=Server.CreateObject("ADODB.Recordset")
    >
    > connection.Open "Data
    > Source=c:\Inetpub\wwwroot\xxxx\fpdb\addnewrecords. mdb" &_
    > ";Provider=Microsoft.Jet.OLEDB.4.0;"
    >
    >
    > recordset.Open "select * From Table", connection,1,2
    >
    > recordset.addnew
    >
    > recordset("socialsecurity")=request.form("ssnumber ")
    > recordset("name")=request.form("name")
    > recordset("age")=request.form("age")
    >
    > recordset.Update
    > recordset.close
    > set connection=nothing
    >
    > response.write "A new record had been added successfully to
    > the database"
    >
    > %>
    >
    > .

    Ray at Guest

  4. #3

    Default Re: Database Update Error

    > recordset.Open "select * From Table", connection,1,2
    >
    > recordset.addnew
    Ugh. Do you know how horribly inefficient this is?

    Anyway, for the error message, skim through:
    [url]http://www.aspfaq.com/2009[/url]

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]


    Aaron Bertrand - MVP Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139