<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsAddirr 'Holds the recordset for the new record to be added
Dim strSQL 'Holds the SQL query to query the database
'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("irr.mdb")
'Create an ADO recordset object
Set rsAddirr = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT irr.Receiver, irr.BOLTracking, irr.Carrier, irr.InternalPart,
irr.VendorPart, irr.POQTY, irr.PackQTY, irr.PhysicalQTY, irr.ShortQTY, irr.OverQTY,
irr.Notes, irr.Location, irr.Date, irr.Day, irr.Month, irr.Year, irr.IssueType, irr.PO,
irr.Order, irr.Serials, irr.DescrepType, irr.StorageLoc, irr.DamagedQTY, irr.USDIR,
irr.ProductMovement FROM irr;"
'Set the cursor type we are using so we can navigate through the recordset
rsAddirr.CursorType = 2
'Set the lock type so that the record is locked by ADO when it is updated
rsAddirr.LockType = 3
'Open the recordset with the SQL query
rsAddirr.Open strSQL, adoCon
'Tell the recordset we are adding a new record to it
rsAddirr.AddNew
'Add a new record to the recordset
rsAddirr.Fields("Receiver") = Request.Form("Receiver")
rsAddirr.Fields("BOLTracking") = Request.Form("BOLTracking")
rsAddirr.Fields("Carrier") = Request.Form("Carrier")
rsAddirr.Fields("InternalPart") = Request.Form("InternalPart")
rsAddirr.Fields("VendorPart") = Request.Form("VendorPart")
rsAddirr.Fields("POQTY") = Request.Form("POQTY")
rsAddirr.Fields("PackQTY") = Request.Form("PackQTY")
rsAddirr.Fields("PhysicalQTY") = Request.Form("PhysicalQTY")
rsAddirr.Fields("ShortQTY") = Request.Form("ShortQTY")
rsAddirr.Fields("OverQTY") = Request.Form("OverQTY")
rsAddirr.Fields("Notes") = Request.Form("Notes")
rsAddirr.Fields("Location") = Request.Form("Location")
rsAddirr.Fields("Date") = Request.Form("Date")
rsAddirr.Fields("Day") = Request.Form("Day")
rsAddirr.Fields("Year") = Request.Form("Year")
rsAddirr.Fields("IssueType") = Request.Form("IssueType")
rsAddirr.Fields("DescrepType") = Request.Form("DescrepType")
rsAddirr.Fields("StorageLoc") = Request.Form("StorageLoc")
rsAddirr.Fields("Month") = Request.Form("Month")
rsAddirr.Fields("PO") = Request.Form("PO")
rsAddirr.Fields("Order") = Request.Form("Order")
rsAddirr.Fields("Serials") = Request.Form("Serials")
rsAddirr.Fields("DamagedQTY") = Request.Form("DamagedQTY")
rsAddirr.Fields("USDIR") = Request.Form("USDIR")
rsAddirr.Fields("ProductMovement") = Request.Form("ProductMovement")
'Write the updated recordset to the database
rsAddirr.Update
'Reset server objects
rsAddirr.Close
Set rsAddirr = Nothing
Set adoCon = Nothing
'Redirect to the default.asp page
Response.Redirect "returndetails.asp?ID=<% Request.Form("ID") %>"
%>