UNABLE TO UPDATE ACCESS TABLE USING ASP


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: UNABLE TO UPDATE ACCESS TABLE USING ASP

  1. #1
    ROBERT LEAHONG Guest

    UNABLE TO UPDATE ACCESS TABLE USING ASP




    Unable to update access database table using Active Server
    Page. Only able to read from table and display information
    on a web page.

    Below is code of an ASP script
    itmsav.asp




    <HTML>
    <HEAD>
    </HEAD>
    <BODY>

    <%
    DIM CONN
    DIM SQLITM
    DIM FITMMST



    Set CONN=Server.CreateObject("ADODB.Connection")
    CONN.Open "FILEDSN=C:\INETPUB\SCRIPTS\SHOPPING.dsn"
    Set FITMMST=Server.CreateObject("ADODB.Recordset")
    SQLITM=" SELECT * FROM ITMMST "
    FITMMST.Open SQLITM, CONN
    CONN.BeginTrans
    FITMMST.Addnew
    FITMMST("ITMDSC")=Request("ITMDSC")
    FITMMST.Update
    CONN.CommitTrans
    FITMMST.Close
    CONN.Close
    Set CONN=NOTHING
    %>


    </BODY>
    </HTML>


    This is the HTML document that calls the ASP script itmsav.asp


    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    <FORM ACTION="http://bobby/scripts/ITMSAV.ASP" method="post">
    ITEM DESCRIPTION <INPUT TYPE="TEXT" NAME="ITMDSC" SIZE="30">
    <INPUT TYPE="SUBMIT" VALUE="SUBMIT">
    </FORM>
    </BODY>





  2. #2
    Andy Robinson Guest

    Re: UNABLE TO UPDATE ACCESS TABLE USING ASP


    "ROBERT LEAHONG" <rleahong@jol.com.jm> wrote:
    >
    >
    >
    > Unable to update access database table using Active Server
    > Page. Only able to read from table and display information
    > on a web page.
    >
    > Below is code of an ASP script
    > itmsav.asp
    >
    >
    >
    >
    > <HTML>
    > <HEAD>
    > </HEAD>
    > <BODY>
    >
    > <%
    > DIM CONN
    > DIM SQLITM
    > DIM FITMMST
    >
    >
    >
    > Set CONN=Server.CreateObject("ADODB.Connection")
    > CONN.Open "FILEDSN=C:\INETPUB\SCRIPTS\SHOPPING.dsn"
    > Set FITMMST=Server.CreateObject("ADODB.Recordset")
    > SQLITM=" SELECT * FROM ITMMST "
    > FITMMST.Open SQLITM, CONN
    > CONN.BeginTrans
    > FITMMST.Addnew
    > FITMMST("ITMDSC")=Request("ITMDSC")
    > FITMMST.Update
    > CONN.CommitTrans
    > FITMMST.Close
    > CONN.Close
    > Set CONN=NOTHING
    > %>
    >
    >
    > </BODY>
    > </HTML>
    >
    >
    > This is the HTML document that calls the ASP script itmsav.asp
    >
    >
    > <HTML>
    > <HEAD>
    > </HEAD>
    > <BODY>
    > <FORM ACTION="http://bobby/scripts/ITMSAV.ASP" method="post">
    > ITEM DESCRIPTION <INPUT TYPE="TEXT" NAME="ITMDSC" SIZE="30">
    > <INPUT TYPE="SUBMIT" VALUE="SUBMIT">
    > </FORM>
    > </BODY>
    >
    >
    >
    >

    The first thing you want to do is make sure you give change privileges (RXWD)
    to the IUSR_{Machine_Name} account. This account is the account that appears
    to the system when an internet user tries to access system resources. By
    giving this account change privileges on the DB (Assuming an Access DB) you
    allow them to edit and update the db.

    one word of warning. It would probably be best to move the db somewhere
    outside of the wwwroot structure just to keep prying eyes from somehow getting
    a hold of it.

    Hope this solves your problem.. maybe
    - Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center