Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. asp ado problem.

asp ado problem.

Scheduled Pinned Locked Moved Database
helpannouncementdatabasesysadmincareer
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RomanD
    wrote on last edited by
    #1

    Every time I run the code below, it tells me "No update permissions!"

    Update Record

    <% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.mapPath("chem.mdb")) cid=Request.Form("shit") response.write(Request.Form("test1")) jon = 1 response.write(jon) if Request.form("test1")<>"" then sql="UPDATE NEWS SET " sql=sql & "DATE='" & now() & "'," sql=sql & "CONTENT='" & Request.Form("test1") & "'" sql=sql & " WHERE ID='" & jon & "'" on error resume next conn.Execute sql, Recordsaffected if err<>0 then response.write("No update permissions!") else response.write("Record " & cid & " was updated!") end if end if conn.close %>

    C M 3 Replies Last reply
    0
    • R RomanD

      Every time I run the code below, it tells me "No update permissions!"

      Update Record

      <% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.mapPath("chem.mdb")) cid=Request.Form("shit") response.write(Request.Form("test1")) jon = 1 response.write(jon) if Request.form("test1")<>"" then sql="UPDATE NEWS SET " sql=sql & "DATE='" & now() & "'," sql=sql & "CONTENT='" & Request.Form("test1") & "'" sql=sql & " WHERE ID='" & jon & "'" on error resume next conn.Execute sql, Recordsaffected if err<>0 then response.write("No update permissions!") else response.write("Record " & cid & " was updated!") end if end if conn.close %>

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      RomanD wrote: Every time I run the code below, it tells me "No update permissions!" I would guess that there is an error in the SQL statement. I would also guess that err does not necessariliy indicate a permissions problem, but your code assumes that any error must be a permissions problem. You should find out what err actually is, and find out what that error number actually means.


      Do you want to know more? WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and Forums

      1 Reply Last reply
      0
      • R RomanD

        Every time I run the code below, it tells me "No update permissions!"

        Update Record

        <% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.mapPath("chem.mdb")) cid=Request.Form("shit") response.write(Request.Form("test1")) jon = 1 response.write(jon) if Request.form("test1")<>"" then sql="UPDATE NEWS SET " sql=sql & "DATE='" & now() & "'," sql=sql & "CONTENT='" & Request.Form("test1") & "'" sql=sql & " WHERE ID='" & jon & "'" on error resume next conn.Execute sql, Recordsaffected if err<>0 then response.write("No update permissions!") else response.write("Record " & cid & " was updated!") end if end if conn.close %>

        M Offline
        M Offline
        mysorian
        wrote on last edited by
        #3

        Could you update using this SQl from within MS Access?

        R 1 Reply Last reply
        0
        • R RomanD

          Every time I run the code below, it tells me "No update permissions!"

          Update Record

          <% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.mapPath("chem.mdb")) cid=Request.Form("shit") response.write(Request.Form("test1")) jon = 1 response.write(jon) if Request.form("test1")<>"" then sql="UPDATE NEWS SET " sql=sql & "DATE='" & now() & "'," sql=sql & "CONTENT='" & Request.Form("test1") & "'" sql=sql & " WHERE ID='" & jon & "'" on error resume next conn.Execute sql, Recordsaffected if err<>0 then response.write("No update permissions!") else response.write("Record " & cid & " was updated!") end if end if conn.close %>

          M Offline
          M Offline
          mysorian
          wrote on last edited by
          #4

          Could you update using this SQl from within MS Access?

          1 Reply Last reply
          0
          • M mysorian

            Could you update using this SQl from within MS Access?

            R Offline
            R Offline
            RomanD
            wrote on last edited by
            #5

            Here is my newest code: sql="SELECT * FROM NEWS WHERE ID="&jon&";" Set rsSrc = Server.CreateObject("ADODB.Recordset") rsSrc.Open sql, oDBConn,0,3 if(not(rsSrc.EOF))then rsSrc("DATE")= Now() rsSrc("CONTENT")=Request.Form("test1") rsSrc.update end if rsSrc.close set rsSrc=nothing Now, the error message I get is that my database/object is readonly. But I think that's a problem with my host.

            M 1 Reply Last reply
            0
            • R RomanD

              Here is my newest code: sql="SELECT * FROM NEWS WHERE ID="&jon&";" Set rsSrc = Server.CreateObject("ADODB.Recordset") rsSrc.Open sql, oDBConn,0,3 if(not(rsSrc.EOF))then rsSrc("DATE")= Now() rsSrc("CONTENT")=Request.Form("test1") rsSrc.update end if rsSrc.close set rsSrc=nothing Now, the error message I get is that my database/object is readonly. But I think that's a problem with my host.

              M Offline
              M Offline
              Mike Dimmick
              wrote on last edited by
              #6

              I suspect that the user account that your ASP page is running under - typically IUSR_machinename - doesn't have NTFS write permissions to the directory that contains the .MDB file. Hence the database is opened read-only and you can't insert new rows or update or delete existing ones. The account needs to be able to write to the directory, not just the file, as the Jet database engine needs to create an .ldb file if multiple connections access the file concurrently. Stability. What an interesting concept. -- Chris Maunder

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups