View Single Post
  #4 (permalink)  
Old February 17th, 2008, 10:23 PM
phuc2583 phuc2583 is offline
Authorized User
 
Join Date: Dec 2007
Location: , , Vietnam.
Posts: 59
Thanks: 9
Thanked 0 Times in 0 Posts
Default

please check the code that wrote
i try do it but not run
if trim(request("Option"))="AddOrder" then
        Set rs = Server.CreateObject("ADODB.Recordset")
       ' rs.Open "orderdetail", conn, 1, 2
          rs.CursorType = 1

          rs.LockType = 3

          rs.Open "orderdetail", Conn

        ' Adding data
            rs.AddNew
         if not rs.eof then
                    strmonth=Right("0" & DatePart("m", Now()), 2)
                    strday=day(date())
                    stryear=Right(DatePart("yyyy", Now()), 2)
                    NewOrderNumber=(rs("orderID")+1)
                    NewsOrderID=stryear & strmonth & strday & Right("0000" & NewOrderNumber, 4)
                    if not rs.eof then

                    'OrderID=session("OrderID")
                        NewOrderNumber=(rs("orderID")+1)
                        OrderID=NewsorderID

                    end if

                   rs("OrderID")= NewsorderID
                rs("CustomerId") = CustomerId
                rs("Item") = Items
                rs("Description") = Descriptions
                rs("Quantity")=Quantity
                rs("price") = price
                rs("UnitCurrency") = UnitCurrency
                rs("CreateDate") = CreateDate
                rs("ExpirationDate") = ExpirationDate
            response.Write(OrderID)
            'rs.Update
                    end if
            session("Neworderid")=NewsorderID
            session("Item")=items
            session("Descriptions")=Descriptions
            session("Quantity")=Quantity
            session("price")=price
            session("UnitCurrency")=UnitCurrency
            session("CreateDate")=CreateDate
            session("ExpirationDate")=ExpirationDate

        response.Redirect "ShowOrderdetail.asp"
        rs.Close
            Set rs = Nothing
    end if

Reply With Quote