#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2012
    Posts
    19
    Rep Power
    0

    Update and insert data by batch in one time


    Hi, As below is the complete two ASP code file, May i know how to write the code to update and insert data by batch in one time ? Hope can modify and advise my source code thank you.




    issue2loc.asp



    <%


    DIM EmpName,EmpID,EmpLevel,STRANSCATEGORY,STRANSCATEGO RY2,STRANSCATEGORY3,STRANSID,STRANSID2,STRANSID3,r ef,ref2,ref3,SLOCATION

    if Request.QueryString("empid") = "" then

    EmpID = Request.Form("HEmpID")
    EmpName = Request.Form("HEmpName")
    EmpLevel = Request.Form("HEmpLevel")

    else

    EmpName = Request.QueryString("Name")
    EmpID = Request.QueryString("empid")
    EmpLevel = Request.Form("EmpLevel")

    end if

    ref = Request.QueryString("ref")
    ref2 = Request.QueryString("ref2")
    ref3 = Request.QueryString("ref3")

    STRANSCATEGORY = Request.Form("STRANSCATEGORY")

    STRANSCATEGORY2 = Request.Form("STRANSCATEGORY2")

    STRANSCATEGORY3 = Request.Form("STRANSCATEGORY3")

    STRANSID = Request.Form("STRANSID")

    STRANSID2 = Request.Form("STRANSID2")

    STRANSID3 = Request.Form("STRANSID3")

    SLOCATION = Request.Form("SLOCATION")

    SLOCATION2 = Request.Form("SLOCATION2")

    TBIN = Request.Form("TBIN")

    TLocation = Request.Form("TLocation")

    CBIN = Request.Form("CBIN")

    TLocation2 = Request.Form("TLocation2")

    CBIN2 = Request.Form("CBIN2")


    '*************** Check TLocation if not null Start ***************

    If TLocation <> "" Then

    SLOCATION = TLocation

    end if

    '*************** Check TLocation if not null end ***************

    DIM mySQL,objRS
    mySQL = "SELECT INV_TYPE FROM OTH_INV_CATEGORY ORDER BY INV_TYPE DESC"

    Set objRS = Server.CreateObject("ADODB.Recordset")

    objRS.Open mySQL, oConnection



    DIM mySQL11,objRS1
    mySQL11 = "SELECT INV_TYPE FROM OTH_INV_CATEGORY ORDER BY INV_TYPE DESC"

    Set objRS1 = Server.CreateObject("ADODB.Recordset")

    objRS1.Open mySQL11, oConnection




    DIM mySQL12,objRS12
    mySQL12 = "SELECT INV_TYPE FROM OTH_INV_CATEGORY ORDER BY INV_TYPE DESC"

    Set objRS12 = Server.CreateObject("ADODB.Recordset")

    objRS12.Open mySQL12, oConnection



    DIM mySQL13,objRS13
    mySQL13 = "SELECT INV_TYPE FROM OTH_INV_CATEGORY ORDER BY INV_TYPE DESC"

    Set objRS13 = Server.CreateObject("ADODB.Recordset")

    objRS13.Open mySQL13, oConnection




    DIM mySQL14,objRS14
    mySQL14 = "SELECT INV_TYPE FROM OTH_INV_CATEGORY ORDER BY INV_TYPE DESC"

    Set objRS14 = Server.CreateObject("ADODB.Recordset")

    objRS14.Open mySQL14, oConnection





    DIM mySQL15,objRS15
    mySQL15 = "SELECT INV_TYPE FROM OTH_INV_CATEGORY ORDER BY INV_TYPE DESC"

    Set objRS15 = Server.CreateObject("ADODB.Recordset")

    objRS15.Open mySQL15, oConnection






    DIM mySQL16,objRS16
    mySQL16 = "SELECT INV_TYPE FROM OTH_INV_CATEGORY ORDER BY INV_TYPE DESC"

    Set objRS16 = Server.CreateObject("ADODB.Recordset")

    objRS16.Open mySQL16, oConnection







    DIM mySQL17,objRS17
    mySQL17 = "SELECT INV_TYPE FROM OTH_INV_CATEGORY ORDER BY INV_TYPE DESC"

    Set objRS17 = Server.CreateObject("ADODB.Recordset")

    objRS17.Open mySQL17, oConnection





    DIM mySQL18,objRS18
    mySQL18 = "SELECT INV_TYPE FROM OTH_INV_CATEGORY ORDER BY INV_TYPE DESC"

    Set objRS18 = Server.CreateObject("ADODB.Recordset")

    objRS18.Open mySQL18, oConnection





    DIM mySQL19,objRS19
    mySQL19 = "SELECT INV_TYPE FROM OTH_INV_CATEGORY ORDER BY INV_TYPE DESC"

    Set objRS19 = Server.CreateObject("ADODB.Recordset")

    objRS19.Open mySQL19, oConnection






    DIM mySQL20,objRS20
    mySQL20 = "SELECT INV_TYPE FROM OTH_INV_CATEGORY ORDER BY INV_TYPE DESC"

    Set objRS20 = Server.CreateObject("ADODB.Recordset")

    objRS20.Open mySQL20, oConnection





    DIM mySQL21,objRS21
    mySQL21 = "SELECT INV_TYPE FROM OTH_INV_CATEGORY ORDER BY INV_TYPE DESC"

    Set objRS21 = Server.CreateObject("ADODB.Recordset")

    objRS21.Open mySQL21, oConnection






    DIM mySQL222,objRS222
    mySQL222 = "SELECT INV_TYPE FROM OTH_INV_CATEGORY ORDER BY INV_TYPE DESC"

    Set objRS222 = Server.CreateObject("ADODB.Recordset")

    objRS222.Open mySQL222, oConnection







    '*************** Inv Type & Inv ID Select Start ***************

    Dim mySQL2,objRS2

    if STRANSCATEGORY <> "" then

    mySQL2 = "SELECT INV_ID,INV_SHORTDESC FROM OTH_INV_DETAILS WHERE INV_TYPE = '"&STRANSCATEGORY&"' ORDER BY INV_ID"

    Set objRS2 = Server.CreateObject("ADODB.Recordset")

    objRS2.Open mySQL2, oConnection

    else

    mySQL2 = "SELECT INV_ID,INV_SHORTDESC FROM OTH_INV_DETAILS ORDER BY INV_ID"

    Set objRS2 = Server.CreateObject("ADODB.Recordset")

    objRS2.Open mySQL2, oConnection

    end if





    '*************** Inv Type & Inv ID Select End ***************


    '*************** Inv ID Details Start ***************
    if STRANSID <> "" then

    DIM mySQLTransID,objRSTransID
    mySQLTransID = "SELECT INV_ID,INV_UNIT,INV_SHORTDESC FROM OTH_INV_DETAILS WHERE INV_ID = '"&STRANSID&"'"

    Set objRSTransID = Server.CreateObject("ADODB.Recordset")

    objRSTransID.Open mySQLTransID, oConnection

    Dim INV_ID,INV_UNIT,INV_SHORTDESC

    INV_ID = objRSTransID("INV_ID")
    INV_UNIT = objRSTransID("INV_UNIT")
    INV_SHORTDESC = objRSTransID("INV_SHORTDESC")


    end if




    Dim mySQL22,objRS22

    if STRANSCATEGORY2 <> "" then

    mySQL22 = "SELECT INV_ID,INV_SHORTDESC FROM OTH_INV_DETAILS WHERE INV_TYPE = '"&STRANSCATEGORY2&"' ORDER BY INV_ID"

    Set objRS22 = Server.CreateObject("ADODB.Recordset")

    objRS22.Open mySQL22, oConnection

    else

    mySQL22 = "SELECT INV_ID,INV_TYPE,INV_SHORTDESC FROM OTH_INV_DETAILS ORDER BY INV_ID"

    Set objRS22 = Server.CreateObject("ADODB.Recordset")

    objRS22.Open mySQL22, oConnection

    end if




    if STRANSID2 <> "" then

    DIM mySQLTransID2,objRSTransID2
    mySQLTransID2 = "SELECT INV_ID,INV_UNIT,INV_SHORTDESC FROM OTH_INV_DETAILS WHERE INV_ID = '"&STRANSID2&"'"

    Set objRSTransID2 = Server.CreateObject("ADODB.Recordset")

    objRSTransID2.Open mySQLTransID2, oConnection

    end if






    Dim mySQL33,objRS33

    if STRANSCATEGORY3 <> "" then

    mySQL33 = "SELECT INV_ID,INV_SHORTDESC FROM OTH_INV_DETAILS WHERE INV_TYPE = '"&STRANSCATEGORY3&"' ORDER BY INV_ID"

    Set objRS33 = Server.CreateObject("ADODB.Recordset")

    objRS33.Open mySQL33, oConnection

    else

    mySQL33 = "SELECT INV_ID,INV_TYPE,INV_SHORTDESC FROM OTH_INV_DETAILS ORDER BY INV_ID"

    Set objRS33 = Server.CreateObject("ADODB.Recordset")

    objRS33.Open mySQL33, oConnection

    end if




    if STRANSID3 <> "" then

    DIM mySQLTransID3,objRSTransID3
    mySQLTransID3 = "SELECT INV_ID,INV_UNIT,INV_SHORTDESC FROM OTH_INV_DETAILS WHERE INV_ID = '"&STRANSID3&"'"

    Set objRSTransID3 = Server.CreateObject("ADODB.Recordset")

    objRSTransID3.Open mySQLTransID3, oConnection

    end if






    Dim mySQL44,objRS44

    if STRANSCATEGORY4 <> "" then

    mySQL44 = "SELECT INV_ID,INV_SHORTDESC FROM OTH_INV_DETAILS WHERE INV_TYPE = '"&STRANSCATEGORY4&"' ORDER BY INV_ID"

    Set objRS44 = Server.CreateObject("ADODB.Recordset")

    objRS44.Open mySQL44, oConnection

    else

    mySQL44 = "SELECT INV_ID,INV_TYPE,INV_SHORTDESC FROM OTH_INV_DETAILS ORDER BY INV_ID"

    Set objRS44 = Server.CreateObject("ADODB.Recordset")

    objRS44.Open mySQL44, oConnection

    end if




    if STRANSID4 <> "" then

    DIM mySQLTransID4,objRSTransID4
    mySQLTransID4 = "SELECT INV_ID,INV_UNIT,INV_SHORTDESC FROM OTH_INV_DETAILS WHERE INV_ID = '"&STRANSID4&"'"

    Set objRSTransID4 = Server.CreateObject("ADODB.Recordset")

    objRSTransID4.Open mySQLTransID4, oConnection

    end if













    Dim mySQL55,objRS55

    if STRANSCATEGORY5 <> "" then

    mySQL55 = "SELECT INV_ID,INV_SHORTDESC FROM OTH_INV_DETAILS WHERE INV_TYPE = '"&STRANSCATEGORY5&"' ORDER BY INV_ID"

    Set objRS55 = Server.CreateObject("ADODB.Recordset")

    objRS55.Open mySQL55, oConnection

    else

    mySQL55 = "SELECT INV_ID,INV_TYPE,INV_SHORTDESC FROM OTH_INV_DETAILS ORDER BY INV_ID"

    Set objRS55 = Server.CreateObject("ADODB.Recordset")

    objRS55.Open mySQL55, oConnection

    end if




    if STRANSID5 <> "" then

    DIM mySQLTransID5,objRSTransID5
    mySQLTransID5 = "SELECT INV_ID,INV_UNIT,INV_SHORTDESC FROM OTH_INV_DETAILS WHERE INV_ID = '"&STRANSID5&"'"

    Set objRSTransID5 = Server.CreateObject("ADODB.Recordset")

    objRSTransID5.Open mySQLTransID5, oConnection

    end if






    Dim mySQL66,objRS66

    if STRANSCATEGORY6 <> "" then

    mySQL66 = "SELECT INV_ID,INV_SHORTDESC FROM OTH_INV_DETAILS WHERE INV_TYPE = '"&STRANSCATEGORY6&"' ORDER BY INV_ID"

    Set objRS66 = Server.CreateObject("ADODB.Recordset")

    objRS66.Open mySQL66, oConnection

    else

    mySQL66 = "SELECT INV_ID,INV_TYPE,INV_SHORTDESC FROM OTH_INV_DETAILS ORDER BY INV_ID"

    Set objRS66 = Server.CreateObject("ADODB.Recordset")

    objRS66.Open mySQL66, oConnection

    end if




    if STRANSID6 <> "" then

    DIM mySQLTransID6,objRSTransID6
    mySQLTransID6 = "SELECT INV_ID,INV_UNIT,INV_SHORTDESC FROM OTH_INV_DETAILS WHERE INV_ID = '"&STRANSID6&"'"

    Set objRSTransID6 = Server.CreateObject("ADODB.Recordset")

    objRSTransID6.Open mySQLTransID6, oConnection

    end if





    DIM mySQL3,objRS3
    mySQL3 = "SELECT INV_REASON_ID,INV_REASON_DESC FROM OTH_INV_REASON WHERE INV_REASON_TYPE = 'MI' ORDER BY INV_REASON_ID"

    Set objRS3 = Server.CreateObject("ADODB.Recordset")

    objRS3.Open mySQL3, oConnection




    DIM mySQL4,objRS4
    mySQL4 = "SELECT INV_REASON_ID,INV_REASON_DESC FROM OTH_INV_REASON WHERE INV_REASON_TYPE = 'MI' ORDER BY INV_REASON_ID"

    Set objRS4 = Server.CreateObject("ADODB.Recordset")

    objRS4.Open mySQL4, oConnection





    DIM mySQL5,objRS5
    mySQL5 = "SELECT INV_REASON_ID,INV_REASON_DESC FROM OTH_INV_REASON WHERE INV_REASON_TYPE = 'MI' ORDER BY INV_REASON_ID"

    Set objRS5 = Server.CreateObject("ADODB.Recordset")

    objRS5.Open mySQL5, oConnection






    DIM mySQL6,objRS6
    mySQL6 = "SELECT INV_REASON_ID,INV_REASON_DESC FROM OTH_INV_REASON WHERE INV_REASON_TYPE = 'MI' ORDER BY INV_REASON_ID"

    Set objRS6 = Server.CreateObject("ADODB.Recordset")

    objRS6.Open mySQL6, oConnection




    DIM mySQL7,objRS7
    mySQL7 = "SELECT INV_REASON_ID,INV_REASON_DESC FROM OTH_INV_REASON WHERE INV_REASON_TYPE = 'MI' ORDER BY INV_REASON_ID"

    Set objRS7 = Server.CreateObject("ADODB.Recordset")

    objRS7.Open mySQL7, oConnection




    DIM mySQL8,objRS8
    mySQL8 = "SELECT INV_REASON_ID,INV_REASON_DESC FROM OTH_INV_REASON WHERE INV_REASON_TYPE = 'MI' ORDER BY INV_REASON_ID"

    Set objRS8 = Server.CreateObject("ADODB.Recordset")

    objRS8.Open mySQL8, oConnection






    <html>
    <body>
    <p align="center">
    <font face="Gill Sans MT" size="6" >
    <b>Welcome <font face="Gill Sans MT" face="Gill Sans MT" color ="DarkBlue" ><%Response.Write EmpName %></font> ...</b>
    </font>
    </p>

    <p align="center">
    <font face="Gill Sans MT" size="6" color ="#C12283">
    <b>MMS Menu</b>
    </font>
    </p>
    <!-- ****** User Menu Start ******************* -->
    <table style="font-family: Gill Sans MT" width="200" border="1" cellpadding="1" align="center">
    <tr>
    <th bgcolor="black" colspan=4><font color="white">User Menu</font></th>
    </tr>
    <tr bgcolor="black">
    <form name="INDEXASP" method="post" action="index.asp">
    <input type="hidden" name="HEmpID" value="<% Response.Write EmpID %>" />
    <input type="hidden" name="HEmpName" value="<% Response.Write EmpName %>" />
    <input type="hidden" name="HEmpLevel" value="<% Response.Write EmpLevel%>" />
    <th bgcolor="black" ><input type="submit" style="height: 30px; width: 150px;font-family: Gill Sans MT" name="Submit" value="Index" /></th>
    </form>
    <form name="LOGOUTASP" method="post" action="login.asp">
    <td bgcolor="black" >
    <input type="submit" style="height: 30px; width: 150px;font-family: Gill Sans MT" name="Submit" value="LogOut" />
    </td>
    </form>
    </tr>
    <tr bgcolor="black">
    </tr>
    </table>
    <br>

    <!-- ****** User Menu End ******************* -->
    <br>

    <!-- ****** Issue Selection Table Start ******************* -->

    <table style="font-family: Gill Sans MT" width="200" border="1" cellpadding="1" align="center">
    <tr>
    <th colspan= 4 align="center">
    <b><font face="Gill Sans MT" color ="red"><% Response.Write ref %></font>
    <font face="Gill Sans MT" color ="blue"><% Response.Write ref2 %></font>
    <font face="Gill Sans MT" color ="green"><% Response.Write ref3 %></font>
    </b>
    </th>
    </tr>




    <tr>
    <th bgcolor ="#336699"><font color="white">From Location</font></th>
    <th align="left" bgcolor="#ECE5B6" >
    <form name="ETRANSASP" method="post" action="issueloc2.asp">
    <input type="hidden" name="HEmpID" value="<% Response.Write EmpID %>" />
    <input type="hidden" name="HEmpName" value="<% Response.Write EmpName %>" />
    <input type="hidden" name="HEmpLevel" value="<% Response.Write EmpLevel%>" />
    <%
    IF SLOCATION ="" Then
    Response.Write ("<select name='SLOCATION' id='SLOCATION' onchange='ETRANSASP.submit()'>")
    Response.Write ("<option selected></option>")

    DO WHILE NOT objRSLocation.EOF

    Response.Write ("<option>")

    Response.Write objRSLocation("INV_LOCATION")

    Response.Write ("</option>")

    objRSLocation.MoveNext
    Loop

    Response.Write ("</select>")
    Response.Write ("<font color='Red'>** </font>")

    ELSE

    Response.Write ("<input type ='text' name='TLocation' value ='")
    Response.Write SLOCATION
    Response.Write ("' style='text-align: Left;color: #0000FF' size = 15 readonly/>")

    IF NOT objRSBIN.EOF THEN

    Response.Write ("<input type='hidden' name='CBin' value='1' />")

    Response.Write ("<br>")
    Response.Write ("<font size = 3 color='gray' >Location Bin : </font>")
    Response.Write ("<select name='TBIN' >")
    Response.Write ("<option selected></option>")

    DO WHILE NOT objRSBIN.EOF

    Response.Write ("<option>")

    Response.Write objRSBIN("INV_BIN")

    Response.Write ("</option>")

    objRSBIN.MoveNext
    Loop

    Response.Write ("</select>")
    Response.Write ("<font color='Red'>** </font>")

    ELSE

    Response.Write ("<input type='hidden' name='CBin value='2' />")

    END IF

    END IF
    %>
    </th>
    <th bgcolor ="#336699"><font color="white">To Location</font></th>
    <th align="left" bgcolor="#ECE5B6" >

    <%
    IF SLOCATION2 ="" Then
    Response.Write ("<select name='SLOCATION2' id='SLOCATION2' onchange='ETRANSASP.submit()'>")
    Response.Write ("<option selected></option>")

    DO WHILE NOT objRSLocation2.EOF

    Response.Write ("<option>")

    Response.Write objRSLocation2("INV_LOCATION")

    Response.Write ("</option>")

    objRSLocation2.MoveNext
    Loop

    Response.Write ("</select>")
    Response.Write ("<font color='Red'>** </font>")

    ELSE

    Response.Write ("<input type ='text' name='TLocation2' value ='")
    Response.Write SLOCATION2
    Response.Write ("' style='text-align: Left;color: #0000FF' size = 15 readonly/>")

    IF NOT objRSBIN2.EOF THEN

    Response.Write ("<input type='hidden' name='CBin2' value='1' />")

    Response.Write ("<br>")
    Response.Write ("<font size = 3 color='gray' >To Location Bin : </font>")
    Response.Write ("<select name='TBIN2' >")
    Response.Write ("<option selected></option>")

    DO WHILE NOT objRSBIN2.EOF

    Response.Write ("<option>")

    Response.Write objRSBIN2("INV_BIN")

    Response.Write ("</option>")

    objRSBIN2.MoveNext
    Loop

    Response.Write ("</select>")
    Response.Write ("<font color='Red'>** </font>")

    ELSE

    Response.Write ("<input type='hidden' name='CBin2' value='2' />")

    END IF

    END IF
    %>


    <tr>
    <th bgcolor ="#336699" ><font color="white">Requestor</font></th>
    <th align="left" bgcolor="#ECE5B6"><input type ="text" name="TREQUESTOR" style="text-align: center" size = 40 /><font color="Red">** </font></th>
    <th bgcolor ="#336699" ><font color="white">Ref_No.</font></th>
    <th align="left" bgcolor="#ECE5B6"><input type ="text" name="TREFNO" style="text-align: center" size = 40 /></th>
    </tr>
    <tr>
    <th bgcolor ="#336699" ><font color="white">Reason ID</font></th>
    <th align="left" colspan=3 bgcolor="#ECE5B6">
    <select name="SREASONID">
    <option selected></option>
    <%
    DO WHILE NOT objRS3.EOF

    %>
    <option value = "<% Response.Write objRS3("INV_REASON_ID")%>">
    <%
    Response.Write objRS3("INV_REASON_ID")
    Response.Write " - "
    Response.Write objRS3("INV_REASON_DESC")
    %>
    </option>
    <%
    objRS3.MoveNext
    Loop
    %>


    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>

    <table style="font-family: Gill Sans MT" width="200" border="1" cellpadding="1" align="center">
    <tr>
    <th colspan= 4 align="center">
    <b><font face="Gill Sans MT" color ="red"><% Response.Write ref %></font>
    <font face="Gill Sans MT" color ="blue"><% Response.Write ref2 %></font>
    <font face="Gill Sans MT" color ="green"><% Response.Write ref3 %></font>
    </b>
    </th>
    </tr>
    <th bgcolor="#336699" colspan = 8><font color="white">Issue Transaction[1]</font></th>
    </tr>
    <tr>
    <th bgcolor="#336699"><font color="white">Inventory Type</font></th>
    <form name="STRANSCATEGORY" method="post" action="issueloc2.asp">
    <th bgcolor="#ECE5B6">
    <input type="hidden" name="HEmpID" value="<% Response.Write EmpID %>" />
    <input type="hidden" name="HEmpName" value="<% Response.Write EmpName %>" />
    <input type="hidden" name="HEmpLevel" value="<% Response.Write EmpLevel%>" />
    <select name="STRANSCATEGORY" onchange="STRANSCATEGORYASP.submit()">
    <option selected></option>
    <%
    DO WHILE NOT objRS.EOF
    %>
    <option>
    <%
    Response.Write objRS("INV_TYPE")
    %>
    </option>
    <%
    objRS.MoveNext
    Loop
    %>
    </select></th>
    </form>
    <th bgcolor="#336699"><font color="white">Inventory ID</font></th>
    <form name="STRANSID" method="post" action="issueloc2.asp">
    <th bgcolor="#ECE5B6">
    <input type="hidden" name="HEmpID" value="<% Response.Write EmpID %>" />
    <input type="hidden" name="HEmpName" value="<% Response.Write EmpName %>" />
    <input type="hidden" name="HEmpLevel" value="<% Response.Write EmpLevel%>" />
    <font color="white">
    <%
    If STRANSCATEGORY <> "" Then
    Response.Write "Inv Type : " & STRANSCATEGORY
    Response.Write "<br>"
    End if
    %>
    </font>
    <select name="STRANSID" onchange ="STRANSIDASP.submit()">
    <option selected></option>
    <%
    DO WHILE NOT objRS2.EOF
    %>
    <option value = '<%Response.Write objRS2("INV_ID") %>'>
    <%
    Response.Write objRS2("INV_ID") & "-" & objRS2("INV_SHORTDESC")
    %>
    </option>
    <%
    objRS2.MoveNext
    Loop
    %>

    <tr>
    <th bgcolor ="#336699" ><font color="white">Quantity</font></th>
    <th align="left" colspan=3 bgcolor="#ECE5B6"><input type ="text" name="TQTY" style="text-align: center" size = 10 /> <input type ="text" name="TUOM" value ="<% Response.Write INV_UNIT %>"style="text-align: center;color: #0000FF" size = 10 / readonly> <font color="Red">** </font> </th>
    </tr>

    <tr>
    <th bgcolor ="#336699" ><font color="white">Reason Remark</font></th>
    <th align="left" colspan=3 bgcolor="#ECE5B6"> <textarea rows="2" cols="90" name="TREASONREMARK"></textarea></th>
    </tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>


    <th bgcolor="#336699" colspan = 8><font color="white">Issue Transaction[2]</font></th>
    </tr>
    <tr>
    <th bgcolor="#336699"><font color="white">Inventory Type</font></th>
    <form name="STRANSCATEGORY" method="post" action="issueloc2.asp">
    <th bgcolor="#ECE5B6">
    <input type="hidden" name="HEmpID" value="<% Response.Write EmpID %>" />
    <input type="hidden" name="HEmpName" value="<% Response.Write EmpName %>" />
    <input type="hidden" name="HEmpLevel" value="<% Response.Write EmpLevel%>" />
    <select name="STRANSCATEGORY" onchange="STRANSCATEGORYASP.submit()">
    <option selected></option>
    <%
    DO WHILE NOT objRS.EOF
    %>
    <option>
    <%
    Response.Write objRS("INV_TYPE")
    %>
    </option>
    <%
    objRS.MoveNext
    Loop
    %>
    </select></th>
    </form>
    <th bgcolor="#336699"><font color="white">Inventory ID</font></th>
    <form name="STRANSID" method="post" action="issueloc2.asp">
    <th bgcolor="#ECE5B6">
    <input type="hidden" name="HEmpID" value="<% Response.Write EmpID %>" />
    <input type="hidden" name="HEmpName" value="<% Response.Write EmpName %>" />
    <input type="hidden" name="HEmpLevel" value="<% Response.Write EmpLevel%>" />
    <font color="white">
    <%
    If STRANSCATEGORY <> "" Then
    Response.Write "Inv Type : " & STRANSCATEGORY
    Response.Write "<br>"
    End if
    %>
    </font>
    <select name="STRANSID" onchange ="STRANSIDASP.submit()">
    <option selected></option>
    <%
    DO WHILE NOT objRS2.EOF
    %>
    <option value = '<%Response.Write objRS2("INV_ID") %>'>
    <%
    Response.Write objRS2("INV_ID") & "-" & objRS2("INV_SHORTDESC")
    %>
    </option>
    <%
    objRS2.MoveNext
    Loop
    %>

    <tr>
    <th bgcolor ="#336699" ><font color="white">Quantity</font></th>
    <th align="left" colspan=3 bgcolor="#ECE5B6"><input type ="text" name="TQTY" style="text-align: center" size = 10 /> <input type ="text" name="TUOM" value ="<% Response.Write INV_UNIT %>"style="text-align: center;color: #0000FF" size = 10 / readonly> <font color="Red">** </font> </th>
    </tr>

    <tr>
    <th bgcolor ="#336699" ><font color="white">Reason Remark</font></th>
    <th align="left" colspan=3 bgcolor="#ECE5B6"> <textarea rows="2" cols="90" name="TREASONREMARK"></textarea></th>
    </tr>

    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>

    <th bgcolor="#336699" colspan = 8><font color="white">Issue Transaction[3]</font></th>
    </tr>
    <tr>
    <th bgcolor="#336699"><font color="white">Inventory Type</font></th>
    <form name="STRANSCATEGORY" method="post" action="issueloc2.asp">
    <th bgcolor="#ECE5B6">
    <input type="hidden" name="HEmpID" value="<% Response.Write EmpID %>" />
    <input type="hidden" name="HEmpName" value="<% Response.Write EmpName %>" />
    <input type="hidden" name="HEmpLevel" value="<% Response.Write EmpLevel%>" />
    <select name="STRANSCATEGORY" onchange="STRANSCATEGORYASP.submit()">
    <option selected></option>
    <%
    DO WHILE NOT objRS.EOF
    %>
    <option>
    <%
    Response.Write objRS("INV_TYPE")
    %>
    </option>
    <%
    objRS.MoveNext
    Loop
    %>
    </select></th>
    </form>
    <th bgcolor="#336699"><font color="white">Inventory ID</font></th>
    <form name="STRANSID" method="post" action="issueloc2.asp">
    <th bgcolor="#ECE5B6">
    <input type="hidden" name="HEmpID" value="<% Response.Write EmpID %>" />
    <input type="hidden" name="HEmpName" value="<% Response.Write EmpName %>" />
    <input type="hidden" name="HEmpLevel" value="<% Response.Write EmpLevel%>" />
    <font color="white">
    <%
    If STRANSCATEGORY <> "" Then
    Response.Write "Inv Type : " & STRANSCATEGORY
    Response.Write "<br>"
    End if
    %>
    </font>
    <select name="STRANSID" onchange ="STRANSIDASP.submit()">
    <option selected></option>
    <%
    DO WHILE NOT objRS2.EOF
    %>
    <option value = '<%Response.Write objRS2("INV_ID") %>'>
    <%
    Response.Write objRS2("INV_ID") & "-" & objRS2("INV_SHORTDESC")
    %>
    </option>
    <%
    objRS2.MoveNext
    Loop
    %>

    <tr>
    <th bgcolor ="#336699" ><font color="white">Quantity</font></th>
    <th align="left" colspan=3 bgcolor="#ECE5B6"><input type ="text" name="TQTY" style="text-align: center" size = 10 /> <input type ="text" name="TUOM" value ="<% Response.Write INV_UNIT %>"style="text-align: center;color: #0000FF" size = 10 / readonly> <font color="Red">** </font> </th>
    </tr>

    <tr>
    <th bgcolor ="#336699" ><font color="white">Reason Remark</font></th>
    <th align="left" colspan=3 bgcolor="#ECE5B6"> <textarea rows="2" cols="90" name="TREASONREMARK"></textarea></th>

    </tr>



    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>

    <th bgcolor="#336699" colspan = 8><font color="white">Issue Transaction[4]</font></th>
    </tr>
    <tr>
    <th bgcolor="#336699"><font color="white">Inventory Type</font></th>
    <form name="STRANSCATEGORY" method="post" action="issueloc2.asp">
    <th bgcolor="#ECE5B6">
    <input type="hidden" name="HEmpID" value="<% Response.Write EmpID %>" />
    <input type="hidden" name="HEmpName" value="<% Response.Write EmpName %>" />
    <input type="hidden" name="HEmpLevel" value="<% Response.Write EmpLevel%>" />
    <select name="STRANSCATEGORY" onchange="STRANSCATEGORYASP.submit()">
    <option selected></option>
    <%
    DO WHILE NOT objRS.EOF
    %>
    <option>
    <%
    Response.Write objRS("INV_TYPE")
    %>
    </option>
    <%
    objRS.MoveNext
    Loop
    %>
    </select></th>
    </form>
    <th bgcolor="#336699"><font color="white">Inventory ID</font></th>
    <form name="STRANSID" method="post" action="issueloc2.asp">
    <th bgcolor="#ECE5B6">
    <input type="hidden" name="HEmpID" value="<% Response.Write EmpID %>" />
    <input type="hidden" name="HEmpName" value="<% Response.Write EmpName %>" />
    <input type="hidden" name="HEmpLevel" value="<% Response.Write EmpLevel%>" />
    <font color="white">
    <%
    If STRANSCATEGORY <> "" Then
    Response.Write "Inv Type : " & STRANSCATEGORY
    Response.Write "<br>"
    End if
    %>
    </font>
    <select name="STRANSID" onchange ="STRANSIDASP.submit()">
    <option selected></option>
    <%
    DO WHILE NOT objRS2.EOF
    %>
    <option value = '<%Response.Write objRS2("INV_ID") %>'>
    <%
    Response.Write objRS2("INV_ID") & "-" & objRS2("INV_SHORTDESC")
    %>
    </option>
    <%
    objRS2.MoveNext
    Loop
    %>

    <tr>
    <th bgcolor ="#336699" ><font color="white">Quantity</font></th>
    <th align="left" colspan=3 bgcolor="#ECE5B6"><input type ="text" name="TQTY" style="text-align: center" size = 10 /> <input type ="text" name="TUOM" value ="<% Response.Write INV_UNIT %>"style="text-align: center;color: #0000FF" size = 10 / readonly> <font color="Red">** </font> </th>
    </tr>

    <tr>
    <th bgcolor ="#336699" ><font color="white">Reason Remark</font></th>
    <th align="left" colspan=3 bgcolor="#ECE5B6"> <textarea rows="2" cols="90" name="TREASONREMARK"></textarea></th>

    </tr>


    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>



    <th bgcolor="#336699" colspan = 8><font color="white">Issue Transaction[5]</font></th>
    </tr>
    <tr>
    <th bgcolor="#336699"><font color="white">Inventory Type</font></th>
    <form name="STRANSCATEGORY" method="post" action="issueloc2.asp">
    <th bgcolor="#ECE5B6">
    <input type="hidden" name="HEmpID" value="<% Response.Write EmpID %>" />
    <input type="hidden" name="HEmpName" value="<% Response.Write EmpName %>" />
    <input type="hidden" name="HEmpLevel" value="<% Response.Write EmpLevel%>" />
    <select name="STRANSCATEGORY" onchange="STRANSCATEGORYASP.submit()">
    <option selected></option>
    <%
    DO WHILE NOT objRS.EOF
    %>
    <option>
    <%
    Response.Write objRS("INV_TYPE")
    %>
    </option>
    <%
    objRS.MoveNext
    Loop
    %>
    </select></th>
    </form>
    <th bgcolor="#336699"><font color="white">Inventory ID</font></th>
    <form name="STRANSID" method="post" action="issueloc2.asp">
    <th bgcolor="#ECE5B6">
    <input type="hidden" name="HEmpID" value="<% Response.Write EmpID %>" />
    <input type="hidden" name="HEmpName" value="<% Response.Write EmpName %>" />
    <input type="hidden" name="HEmpLevel" value="<% Response.Write EmpLevel%>" />
    <font color="white">
    <%
    If STRANSCATEGORY <> "" Then
    Response.Write "Inv Type : " & STRANSCATEGORY
    Response.Write "<br>"
    End if
    %>
    </font>
    <select name="STRANSID" onchange ="STRANSIDASP.submit()">
    <option selected></option>
    <%
    DO WHILE NOT objRS2.EOF
    %>
    <option value = '<%Response.Write objRS2("INV_ID") %>'>
    <%
    Response.Write objRS2("INV_ID") & "-" & objRS2("INV_SHORTDESC")
    %>
    </option>
    <%
    objRS2.MoveNext
    Loop
    %>

    <tr>
    <th bgcolor ="#336699" ><font color="white">Quantity</font></th>
    <th align="left" colspan=3 bgcolor="#ECE5B6"><input type ="text" name="TQTY" style="text-align: center" size = 10 /> <input type ="text" name="TUOM" value ="<% Response.Write INV_UNIT %>"style="text-align: center;color: #0000FF" size = 10 / readonly> <font color="Red">** </font> </th>
    </tr>

    <tr>
    <th bgcolor ="#336699" ><font color="white">Reason Remark</font></th>
    <th align="left" colspan=3 bgcolor="#ECE5B6"> <textarea rows="2" cols="90" name="TREASONREMARK"></textarea></th>

    </tr>


    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>



    </html>
    <%
    oConnection.Close
    Set oConnection = Nothing
    %>
  2. #2
  3. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,594
    Rep Power
    278
    I did not found any update statements in your code...
    I do not know really what you want, but looking on your page it is number of major problems there.
    1. HTML code not follow any standards... it may be looks good on your IE, but I can warranty it wilt not work on majority of users...
    you have
    Code:
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    <tr>
    sorry it is not valid it must be <tr><td></td></tr> or <tr><th></th></tr> structure...
    second big error in html is
    Code:
    <input type ="text" name="TUOM" value ="<% Response.Write INV_UNIT %>"style="text-align: center;color: #0000FF" size = 10 / readonly>
    it is must be
    Code:
    <input type ="text" name="TUOM" value ="<% Response.Write INV_UNIT %>"style="text-align: center;color: #0000FF" size ="10" readonly />
    Plz make sure your HTML code correct.
    2. you have sql like "SELECT INV_TYPE FROM OTH_INV_CATEGORY ORDER BY INV_TYPE DESC" more them 20 times in your page and every time you open new recordset with the same data... It will just use server resoupces and will not give your anything. One recordset like that it is all what you need.

    all your code just read data from database and print on screen, where you need to run insert or update???
    GK
    __________________________________________________ _____
    if you found this post is useful click Give Rep button (bottom side on this reply ) and agree
  4. #3
  5. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2012
    Posts
    19
    Rep Power
    0
    Hi, GK

    the purpose i want is after update and straight insert data by batch in one time in one form,
    Example, i have ten transaction item in one form, after i click update button, it will straight update ten item record and insert into database ten item in one time. any ideas ?

    thank you
  6. #4
  7. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,594
    Rep Power
    278
    you can loop thru your form and run updates, I did not get where is the problem if you want to make sure you updates all or nothing you can use recordset and open for bachupdate and in thins case you can do that very accurate with warranty all records updated or nothing updated... and in your page you need just 1 recordset, which you can reuse a few times (definitely do not need 20 plus identical recordsets)
  8. #5
  9. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Oct 2012
    Posts
    19
    Rep Power
    0
    Hi Gk ,

    Can you give me the example of loop thru form and update ?


    thank you.

Similar Threads

  1. Update and Insert at the same time in 1 form
    By scottiepip in forum ASP Development
    Replies: 5
    Last Post: November 13th, 2008, 03:19 AM
  2. Insert,Update,delete data from a table
    By Salman8506 in forum ASP Development
    Replies: 11
    Last Post: April 9th, 2007, 06:34 AM
  3. Insert and update the same time
    By SmileSmita in forum ASP Development
    Replies: 21
    Last Post: July 6th, 2006, 02:44 AM
  4. cannot update, insert data to database
    By pentellcc in forum ASP Development
    Replies: 5
    Last Post: September 21st, 2004, 01:31 PM
  5. Insert , Delete ,Update Data Using SQL Connection
    By e179 in forum Microsoft SQL Server
    Replies: 3
    Last Post: January 10th, 2003, 04:40 AM

IMN logo majestic logo threadwatch logo seochat tools logo