Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Location
    Malaysia
    Posts
    7

    Unanswered: Err: No update permissionSyntax error in INSERT INTO statement.

    PLz help i am trying to design a basic asp which include 3 page of asp file.
    1.name.asp -which let ppl key in their name & gender
    2.view.asp-View the input field from the name.asp and when click submit mean the page will go in to the display.asp
    3. Display.asp- display a message to inform the ppl tht their data already been store.

    But after my page run till display.asp some error will show on the browser page which is...

    9/29/2003 11:09:16 AMNo update permissionSyntax error in INSERT INTO statement.

    Below i include my display.asp part n my view.asp
    --view.asp--
    <p>Name:
    <%response.write(request.form("txtname"))%>
    <br>
    Gender:
    <%response.write(request.form("txtsex"))%>
    </p>
    <p>&nbsp;</p>
    <form name="form1" method="post" action="display.asp">
    <input type="submit" name="Submit" value="Submit">
    <input type="reset" name="Submit2" value="Reset">
    </form>


    --display.asp--
    <%
    response.write(Now())
    %>
    <%
    dim sql
    dim conn
    set conn=Server.CreateObject("ADODB.Connection")
    conn.Provider="Microsoft.Jet.OLEDB.4.0"
    conn.Open "C:\Host\demo\demo.mdb"

    txtname =replace(txtname,"'","''")
    txtsex =replace(txtsex,"'","''")

    sql="INSERT INTO tblUsers (Usernames,Gender)"
    sql=sql & "VALUES"

    on error resume next
    conn.Execute sql,recaffected
    if err<>0 then
    Response.Write("No update permission" & err.description)
    else
    Response.Write("<h3>" & recaffected & " record added</h3>")
    end if
    Set sql = Nothing

    conn.close
    %>



    <p><a href="name.asp">Back</a></p>
    <table width="90%" border="0">
    <tr>
    <td width="11%">&nbsp;</td>
    <td width="89%">&nbsp;</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <%
    dim rsSex
    dim cnSex
    dim strDBPath
    set cnSex=server.CreateObject("adodb.connection")
    set rsSex=server.CreateObject("adodb.recordset")
    strDBPath = Server.MapPath("demo.mdb")

    'cnSex.open "c:/Host/demo/demo.mdb"
    cnSex.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"

    'rsSex = "SELECT * FROM tblUsers "
    Set rsSex = cnSex.Execute("SELECT * FROM tblUsers")
    %>

    <%
    do while not rsSex.EOF
    response.Write"<td>" & rsSex("Gender"& err.description)&"</td>"
    rsSex.movenext
    loop

    rssex.close
    set rssex = nothing
    cnSex.Close
    set cnSex = nothing
    %>
    </tr>
    </table>


    please help.thanks

  2. #2
    Join Date
    Sep 2003
    Posts
    14
    Hey applelzy!!

    Are Usernames,Gender names of columns or values???
    And where are the values to be inserted?

    I guess the SQL query should be INSERT into TABLENAME (Column_name1, Column_name2) VALUES(x, y)

    Am I right?

    Usha

  3. #3
    Join Date
    Sep 2003
    Location
    Malaysia
    Posts
    7

    Yeah, tht is my table name & column name

    Hi thr,
    actually the tblusers is the correct table name & the usernames and gender r also the correct column field...
    so can u plz help....

  4. #4
    Join Date
    Oct 2003
    Posts
    1

    Lightbulb updating a mdb

    Hi. Long time ago I had that problem (I supouse). My ASP pages were working OK, but when I tried to update a registry, it came with a "not updeatable " permission. You have to go to the FOLDER (not to the database) that contain the database (in this case the DEMO Folder) and allow to write (Security). This is because the acces creates lock files in the folder, and then the folder must have the permissions.

    I hope it helps you

  5. #5
    Join Date
    Sep 2003
    Location
    Malaysia
    Posts
    7

    Thanks problem solve

    Thanks,yeah need to do something bout the mdb security folder.Thanks=)

Posting Permissions

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