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

    Unanswered: How to save the data from a display page into database?

    Dear all,
    I m doin 3 process page.
    1- admin_ctrlpanel.asp( this is whr they input all field)
    2- admin_settingview.asp( this is only let them view whether the field they enter correct or not)
    3- ctrlpanel_process.asp ( this is only process when they r satisfy with wht they already keyed, and here only will store every field into mydatabase)

    -------------------------------------------------------------------
    admin_settingview.asp
    -------------------------------------------------------------------
    <form action="ctrlpanel_process.asp" method="post">
    <table width="80%" border="0" align="center">
    <tr class="header">
    <td colspan="2"><B class="font02">&lt;&lt; Adminstrative Options &gt;&gt;</B></td>
    </tr>
    <tr class="header">
    <td colspan="2">&lt;&lt; Application Options &gt;&gt;</td>
    </tr>
    <tr class="naming2">
    <td width="28%">Add a New Category</td>
    <td>
    <%response.write(request.form("txtNewCat"))%>
    </td>
    </tr>
    <tr class="naming2">
    <td>Delete Category</td>
    <td>
    <%response.write(request.form("select1"))%>
    </td>
    </tr>
    <tr class="naming2">
    <td>Blocked Words</td>
    <td>
    <%response.write(request.form("select4"))%>
    </td>
    </tr>
    </table>
    <p>&nbsp;</p>
    <table width="70%" border="0" align="center">
    <tr class="header">
    <td colspan="2">&lt;&lt; Security Options &gt;&gt;</td>
    </tr>
    <tr class="naming2">
    <td width="40%">Admin ID</td>
    <td width="60%">
    <%response.write(request.form("txtAdminNewID"))% >
    </td>
    </tr>
    <tr class="naming2">
    <td>Admin Password</td>
    <td>
    <%response.write(request.form("txtAdminPwd"))%>
    </td>
    </tr>
    <tr class="naming2">
    <td>Confirm Admin New Password</td>
    <td><%response.write(request.form("txtConfirmPwd") )%></td>
    </tr>
    <tr class="naming2">
    <td>Admin Nickname</td>
    <td>
    <%response.write(request.form("txtAdminNick"))%>
    </td>
    </tr>
    <tr class="naming2">
    <td>Nickname Password</td>
    <td>
    <%response.write(request.form("txtNickPwd"))%>
    </td>
    </tr>
    </table>
    <p>&nbsp;</p>
    <table width="40%" border="0" align="center">
    <tr>
    <td><div align="center">
    <input type="submit" name="Submit" value="Submit">
    </div></td>
    <td><div align="center">
    <input type="reset" name="Submit2" value="Reset">
    </div></td>
    </tr>
    </table>
    <p>&nbsp;</p>
    </form>
    --------------------------------------------------------------------------
    ctrlpanel_process.asp
    --------------------------------------------------------
    <%
    dim sql

    set conn=Server.CreateObject("ADODB.Connection")
    conn.Provider="Microsoft.Jet.OLEDB.4.0"
    conn.Open "C:\Host\forum\complete\chatbox.mdb"
    sql="INSERT INTO tbCategory (CategoryName)"
    sql=sql & "VALUES"
    sql=sql & "('"& Request.Form("txtNewCat") & "')"

    on error resume next
    conn.Execute sql,recaffected
    if err<>0 then
    Response.Write("Sorry !<br> No update permission<br>" & err.description)
    else
    Response.Write("<h3>" & recaffected & " record added</h3>")
    end if
    conn.close
    %>
    ----------------------------------
    May I know tht is there any way to update into the db? Actually both page can run. But only when i check the database file--chatbox.mdb, there's nothing store even the 1 record added msg prompt out after the settingview.asp ...
    PLz help.thanks!

  2. #2
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    You might want to check out the database example(s) at www.asp101.com/samples
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

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