How can I make multiple entries in a SQL Database with just one form.
I sometimes get hardware where there is only 1 PO, but for like 100 items.
The information is the same, except for the serial number.
How can I enter the serial number in say a field of some kind and than Insert Into the database as separate records, but with the serial number different. This is what I have so far, which is for one record. What I do now is enter the serial number in the Notes Field and than have to search for quite some time to get each one or if the number of items is low, I enter them separately one by one.
Can you help me with this please, or let me know where I can get some information for this type issue?
SQL Statement:
<%
Set RS = Server.CreateObject("ADODB.Recordset"
SqlString = "SELECT PCs.PONumber, PCs.SerialNumber, PCs.Department, Department.Department, PCs.Requestor, Users.UserName, PCs.Notes, PCs.ReceivedBy, Technicians.TechName, PCs.Arrival, PCs.Brand, Manufacturer.Manufacturer, PCs.Model, PCs.Speed, PCs.RAM, PCs.HardDrive, PCs.Inventory, PCs.Temporary, PCs.Delivered, PCs.Location"
SqlString = SqlString & " FROM (((PCs INNER JOIN Department ON PCs.Department = Department.DepartmentID) INNER JOIN Users ON PCs.Requestor = Users.UserID) INNER JOIN Technicians ON PCs.ReceivedBy = Technicians.TechID) INNER JOIN Manufacturer ON PCs.Brand = Manufacturer.BrandID "
Set RS = objConn.Execute ( SqlString )
%>
The Form:
<table width="100%" border="1" cellpadding="0" cellspacing="2" bordercolor="#000000" class="Graph">
<!--DWLayoutTable-->
<tr>
<td width="262" height="14" nowrap bgcolor="EEEEE0"> <div align="center">Brand
of PC</div></td>
<td width="718" rowspan="29" valign="top" bgcolor="EEEEE0"><div align="center">Notes<BR>
<textarea name="Notes" cols="55" rows="28" id="Select13"></textarea>
</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF"> <div align="right">
<select name="Brand" size="1" class="inputBox" id="Select1">
<% WHILE NOT RS4.EOF %>
<option value="<%=RS4("BrandID"
%>"><%=RS4("Manufacturer"
%></option>
<%
RS4.MoveNext
WEND
%>
</select>
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Model</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF">
<div align="center">
<input name="Model" type=text class="inputBox" id="Select2">
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Speed (insert
only the number)</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF">
<div align="center">
<input name="Speed" type=text class="inputBox" id="Select3">
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">RAM (insert
only the number)</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF">
<div align="center">
<input name="RAM" type=text class="inputBox" id="Select4">
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Hard Drive
(insert only the number)</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF">
<div align="center">
<input name="HardDrive" type=text class="inputBox" id="Select5">
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">PO (If Known)</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF">
<div align="center">
<input name="PONumber" type=text class="inputBox" id="Select6">
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Serial Number</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF">
<div align="center">
<input name="SerialNumber" type=text class="inputBox" id="Select7">
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Department</div></td>
</tr>
<tr>
<td height="22" nowrap bordercolor="#FFFFFF"> <div align="right">
<select name="Department" size="1" class="inputBox" id="select8">
<% WHILE NOT RS3.EOF %>
<option value="<%=RS3("DepartmentID"
%>"><%=RS3("Department"
%></option>
<%
RS3.MoveNext
WEND
%>
</select>
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Requestor</div></td>
</tr>
<tr>
<td height="22" nowrap bordercolor="#FFFFFF"> <div align="right">
<select name="Requestor" size="1" class="inputBox" id="select9">
<% WHILE NOT RS2.EOF %>
<option value="<%=RS2("UserID"
%>"><%=RS2("UserName"
%></option>
<%
RS2.MoveNext
WEND
%>
</select>
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Received By</div></td>
</tr>
<tr>
<td height="22" nowrap bordercolor="#FFFFFF"> <div align="right">
<select name="ReceivedBy" size="1" class="inputBox" id="select10">
<% WHILE NOT RS1.EOF %>
<option value="<%=RS1("TechID"
%>"><%=RS1("TechName"
%></option>
<%
RS1.MoveNext
WEND
%>
</select>
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Arrival Date</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF"> <div align="center">
<input name="Arrival" type=text class="inputBox" id="Select11" value="<%= Date() %>">
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Inventory</div></td>
</tr>
<tr>
<td height="16" nowrap bordercolor="#FFFFFF">
<div align="center">
<input type="radio" name="Inventory" value="1">
Yes
<input name="Inventory" type="radio" value="2" checked>
No</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="left">Temporary (YES
if the PC is given away Temp)</div></td>
</tr>
<tr>
<td height="16" nowrap> <div align="center">
<input type="radio" name="Temporary" value="1">
Yes
<input name="Temporary" type="radio" value="2" checked>
No</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="left">Delivered? (If
the PC has been delievered)</div></td>
</tr>
<tr>
<td height="16" nowrap bordercolor="#FFFFFF">
<div align="center">
<input type="radio" name="Delivered" value="1">
Yes
<input name="Delivered" type="radio" value="2" checked>
No</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"><div align="center">Location of
Equipment</div></td>
</tr>
<tr>
<td nowrap bordercolor="#FFFFFF"> <div align="center">
<input name="Location" type=text class="inputBox" id="Select12">
</div></td>
<td bordercolor="#FFFFFF"><div align="right">
<input name="Reset" type="reset" class="inputSubmit" value="Reset">
<input name="Submit2" type="submit" class="inputSubmit" value="Submit">
</div></td>
</tr>
</table>
The Insert Page:
<%
PONumber = TRIM( Request.Form( "PONumber"
)
SerialNumber = TRIM( Request.Form( "SerialNumber" ) )
Department = TRIM( Request.Form( "Department" ) )
Requestor = TRIM( Request.Form( "Requestor" ) )
Notes = TRIM( Request.Form( "Notes" ) )
ReceivedBy = TRIM( Request.Form( "ReceivedBy" ) )
Arrival = TRIM( Request.Form( "Arrival" ) )
Brand = TRIM( Request.Form( "Brand" ) )
Model = TRIM( Request.Form( "Model" ) )
Speed = TRIM( Request.Form( "Speed" ) )
RAM = TRIM( Request.Form( "RAM" ) )
HardDrive = TRIM( Request.Form( "HardDrive" ) )
Inventory = TRIM( Request.Form( "Inventory" ) )
Temporary = TRIM( Request.Form( "Temporary" ) )
Delivered = TRIM( Request.Form( "Delivered" ) )
Location = TRIM( Request.Form( "Location" ) )
sqlString = "INSERT INTO PCs (PONumber,SerialNumber,Department,Requestor,Notes,ReceivedBy,Arrival,Brand,Model,Speed,RAM,HardDrive,Inventory,Temporary,Delivered,Location)"
sqlString = sqlString & " VALUES ('" & PONumber & "','" & SerialNumber & "','" & Department & "','" & Requestor & "','" & Notes & "','" & ReceivedBy & "','" & Arrival & "','" & Brand & "','" & Model & "','" & Speed & "','" & RAM & "','" & HardDrive & "','" & Inventory & "','" & Temporary & "','" & Delivered & "','" & Location & "')"
SET RS = objConn.Execute( sqlString )
%>
Is there a way to do multiple entries with one form from what I have?
THANK YOU...
I sometimes get hardware where there is only 1 PO, but for like 100 items.
The information is the same, except for the serial number.
How can I enter the serial number in say a field of some kind and than Insert Into the database as separate records, but with the serial number different. This is what I have so far, which is for one record. What I do now is enter the serial number in the Notes Field and than have to search for quite some time to get each one or if the number of items is low, I enter them separately one by one.
Can you help me with this please, or let me know where I can get some information for this type issue?
SQL Statement:
<%
Set RS = Server.CreateObject("ADODB.Recordset"
SqlString = "SELECT PCs.PONumber, PCs.SerialNumber, PCs.Department, Department.Department, PCs.Requestor, Users.UserName, PCs.Notes, PCs.ReceivedBy, Technicians.TechName, PCs.Arrival, PCs.Brand, Manufacturer.Manufacturer, PCs.Model, PCs.Speed, PCs.RAM, PCs.HardDrive, PCs.Inventory, PCs.Temporary, PCs.Delivered, PCs.Location"
SqlString = SqlString & " FROM (((PCs INNER JOIN Department ON PCs.Department = Department.DepartmentID) INNER JOIN Users ON PCs.Requestor = Users.UserID) INNER JOIN Technicians ON PCs.ReceivedBy = Technicians.TechID) INNER JOIN Manufacturer ON PCs.Brand = Manufacturer.BrandID "
Set RS = objConn.Execute ( SqlString )
%>
The Form:
<table width="100%" border="1" cellpadding="0" cellspacing="2" bordercolor="#000000" class="Graph">
<!--DWLayoutTable-->
<tr>
<td width="262" height="14" nowrap bgcolor="EEEEE0"> <div align="center">Brand
of PC</div></td>
<td width="718" rowspan="29" valign="top" bgcolor="EEEEE0"><div align="center">Notes<BR>
<textarea name="Notes" cols="55" rows="28" id="Select13"></textarea>
</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF"> <div align="right">
<select name="Brand" size="1" class="inputBox" id="Select1">
<% WHILE NOT RS4.EOF %>
<option value="<%=RS4("BrandID"
<%
RS4.MoveNext
WEND
%>
</select>
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Model</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF">
<div align="center">
<input name="Model" type=text class="inputBox" id="Select2">
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Speed (insert
only the number)</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF">
<div align="center">
<input name="Speed" type=text class="inputBox" id="Select3">
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">RAM (insert
only the number)</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF">
<div align="center">
<input name="RAM" type=text class="inputBox" id="Select4">
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Hard Drive
(insert only the number)</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF">
<div align="center">
<input name="HardDrive" type=text class="inputBox" id="Select5">
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">PO (If Known)</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF">
<div align="center">
<input name="PONumber" type=text class="inputBox" id="Select6">
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Serial Number</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF">
<div align="center">
<input name="SerialNumber" type=text class="inputBox" id="Select7">
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Department</div></td>
</tr>
<tr>
<td height="22" nowrap bordercolor="#FFFFFF"> <div align="right">
<select name="Department" size="1" class="inputBox" id="select8">
<% WHILE NOT RS3.EOF %>
<option value="<%=RS3("DepartmentID"
<%
RS3.MoveNext
WEND
%>
</select>
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Requestor</div></td>
</tr>
<tr>
<td height="22" nowrap bordercolor="#FFFFFF"> <div align="right">
<select name="Requestor" size="1" class="inputBox" id="select9">
<% WHILE NOT RS2.EOF %>
<option value="<%=RS2("UserID"
<%
RS2.MoveNext
WEND
%>
</select>
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Received By</div></td>
</tr>
<tr>
<td height="22" nowrap bordercolor="#FFFFFF"> <div align="right">
<select name="ReceivedBy" size="1" class="inputBox" id="select10">
<% WHILE NOT RS1.EOF %>
<option value="<%=RS1("TechID"
<%
RS1.MoveNext
WEND
%>
</select>
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Arrival Date</div></td>
</tr>
<tr>
<td height="19" nowrap bordercolor="#FFFFFF"> <div align="center">
<input name="Arrival" type=text class="inputBox" id="Select11" value="<%= Date() %>">
</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="center">Inventory</div></td>
</tr>
<tr>
<td height="16" nowrap bordercolor="#FFFFFF">
<div align="center">
<input type="radio" name="Inventory" value="1">
Yes
<input name="Inventory" type="radio" value="2" checked>
No</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="left">Temporary (YES
if the PC is given away Temp)</div></td>
</tr>
<tr>
<td height="16" nowrap> <div align="center">
<input type="radio" name="Temporary" value="1">
Yes
<input name="Temporary" type="radio" value="2" checked>
No</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"> <div align="left">Delivered? (If
the PC has been delievered)</div></td>
</tr>
<tr>
<td height="16" nowrap bordercolor="#FFFFFF">
<div align="center">
<input type="radio" name="Delivered" value="1">
Yes
<input name="Delivered" type="radio" value="2" checked>
No</div></td>
</tr>
<tr>
<td height="14" nowrap bgcolor="EEEEE0"><div align="center">Location of
Equipment</div></td>
</tr>
<tr>
<td nowrap bordercolor="#FFFFFF"> <div align="center">
<input name="Location" type=text class="inputBox" id="Select12">
</div></td>
<td bordercolor="#FFFFFF"><div align="right">
<input name="Reset" type="reset" class="inputSubmit" value="Reset">
<input name="Submit2" type="submit" class="inputSubmit" value="Submit">
</div></td>
</tr>
</table>
The Insert Page:
<%
PONumber = TRIM( Request.Form( "PONumber"
SerialNumber = TRIM( Request.Form( "SerialNumber" ) )
Department = TRIM( Request.Form( "Department" ) )
Requestor = TRIM( Request.Form( "Requestor" ) )
Notes = TRIM( Request.Form( "Notes" ) )
ReceivedBy = TRIM( Request.Form( "ReceivedBy" ) )
Arrival = TRIM( Request.Form( "Arrival" ) )
Brand = TRIM( Request.Form( "Brand" ) )
Model = TRIM( Request.Form( "Model" ) )
Speed = TRIM( Request.Form( "Speed" ) )
RAM = TRIM( Request.Form( "RAM" ) )
HardDrive = TRIM( Request.Form( "HardDrive" ) )
Inventory = TRIM( Request.Form( "Inventory" ) )
Temporary = TRIM( Request.Form( "Temporary" ) )
Delivered = TRIM( Request.Form( "Delivered" ) )
Location = TRIM( Request.Form( "Location" ) )
sqlString = "INSERT INTO PCs (PONumber,SerialNumber,Department,Requestor,Notes,ReceivedBy,Arrival,Brand,Model,Speed,RAM,HardDrive,Inventory,Temporary,Delivered,Location)"
sqlString = sqlString & " VALUES ('" & PONumber & "','" & SerialNumber & "','" & Department & "','" & Requestor & "','" & Notes & "','" & ReceivedBy & "','" & Arrival & "','" & Brand & "','" & Model & "','" & Speed & "','" & RAM & "','" & HardDrive & "','" & Inventory & "','" & Temporary & "','" & Delivered & "','" & Location & "')"
SET RS = objConn.Execute( sqlString )
%>
Is there a way to do multiple entries with one form from what I have?
THANK YOU...