ScottNomus
Programmer
I am still working on a Web based database using ASP.
I have several forms that I am having to create. The code that will be listed below is on the 1st form. The customer enters in information and click the submit button. When they do this it needs to query the database and give them an output of open sales orders.
I need to figure out how to get the submit button to do this and send it to another page.
****I AM STILL REAL NEW TO THSI SO ANY HELP IS WELCOMED****
If you need to see anything else let me know and I will get it to you.
**********HERE IS THE PAGE**************
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/WebCustomer.asp" -->
<%
set Inquiry_1 = Server.CreateObject("ADODB.Recordset"
Inquiry_1.ActiveConnection = MM_WebCustomer_STRING
Inquiry_1.Source = "SELECT Customer FROM open_so_inq"
Inquiry_1.CursorType = 0
Inquiry_1.CursorLocation = 2
Inquiry_1.LockType = 3
Inquiry_1.Open()
Inquiry_1_numRows = 0
%>
<%
set ShipToCode = Server.CreateObject("ADODB.Recordset"
ShipToCode.ActiveConnection = MM_WebCustomer_STRING
ShipToCode.Source = "SELECT ShipToCode FROM open_so_inq"
ShipToCode.CursorType = 0
ShipToCode.CursorLocation = 2
ShipToCode.LockType = 3
ShipToCode.Open()
ShipToCode_numRows = 0
%>
<%
set ItemNumber = Server.CreateObject("ADODB.Recordset"
ItemNumber.ActiveConnection = MM_WebCustomer_STRING
ItemNumber.Source = "SELECT ItemNumber FROM open_so_inq"
ItemNumber.CursorType = 0
ItemNumber.CursorLocation = 2
ItemNumber.LockType = 3
ItemNumber.Open()
ItemNumber_numRows = 0
%>
<%
set City = Server.CreateObject("ADODB.Recordset"
City.ActiveConnection = MM_WebCustomer_STRING
City.Source = "SELECT ShipToCity FROM open_so_inq"
City.CursorType = 0
City.CursorLocation = 2
City.LockType = 3
City.Open()
City_numRows = 0
%>
<%
set States = Server.CreateObject("ADODB.Recordset"
States.ActiveConnection = MM_WebCustomer_STRING
States.Source = "SELECT statename FROM states"
States.CursorType = 0
States.CursorLocation = 2
States.LockType = 3
States.Open()
States_numRows = 0
%>
<%
set PONumber = Server.CreateObject("ADODB.Recordset"
PONumber.ActiveConnection = MM_WebCustomer_STRING
PONumber.Source = "SELECT PONumber FROM open_so_inq"
PONumber.CursorType = 0
PONumber.CursorLocation = 2
PONumber.LockType = 3
PONumber.Open()
PONumber_numRows = 0
%>
<%
set ShiptoName = Server.CreateObject("ADODB.Recordset"
ShiptoName.ActiveConnection = MM_WebCustomer_STRING
ShiptoName.Source = "SELECT ShipToName FROM open_so_inq"
ShiptoName.CursorType = 0
ShiptoName.CursorLocation = 2
ShiptoName.LockType = 3
ShiptoName.Open()
ShiptoName_numRows = 0
%>
<%
set Addr1 = Server.CreateObject("ADODB.Recordset"
Addr1.ActiveConnection = MM_WebCustomer_STRING
Addr1.Source = "SELECT ShipToAddress1 FROM open_so_inq"
Addr1.CursorType = 0
Addr1.CursorLocation = 2
Addr1.LockType = 3
Addr1.Open()
Addr1_numRows = 0
%>
<%
set Addr2 = Server.CreateObject("ADODB.Recordset"
Addr2.ActiveConnection = MM_WebCustomer_STRING
Addr2.Source = "SELECT ShipToAddress2 FROM open_so_inq"
Addr2.CursorType = 0
Addr2.CursorLocation = 2
Addr2.LockType = 3
Addr2.Open()
Addr2_numRows = 0
%>
<%
set Filter_Query = Server.CreateObject("ADODB.Recordset"
Filter_Query.ActiveConnection = MM_WebCustomer_STRING
Filter_Query.Source = "SELECT * FROM open_so_inq"
Filter_Query.CursorType = 0
Filter_Query.CursorLocation = 2
Filter_Query.LockType = 3
Filter_Query.Open()
Filter_Query_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<div align="center">
<p><img src="Images/Nomus%20Logo%20.JPG" width="335" height="256"> </p>
<form method="post" action="">
<table width="668" border="0">
<tr>
<td>Customer</td>
<td>
<select name="select">
<%
While (NOT Inquiry_1.EOF)
%>
<option value="<%=(Inquiry_1.Fields.Item("Customer".Value)%>" ><%=(Inquiry_1.Fields.Item("Customer".Value)%></option>
<%
Inquiry_1.MoveNext()
Wend
If (Inquiry_1.CursorType > 0) Then
Inquiry_1.MoveFirst
Else
Inquiry_1.Requery
End If
%>
</select>
</td>
<td>Ship to Name</td>
<td>
<input type="text" name="textfield2" value="<%=(ShiptoName.Fields.Item("ShipToName".Value)%>">
</td>
<td>
<input type="submit" name="Submit" value="Filter">
</td>
</tr>
<tr>
<td>Ship To Code</td>
<td>
<select name="select2">
<%
While (NOT ShipToCode.EOF)
%>
<option value="<%=(ShipToCode.Fields.Item("ShipToCode".Value)%>" ><%=(ShipToCode.Fields.Item("ShipToCode".Value)%></option>
<%
ShipToCode.MoveNext()
Wend
If (ShipToCode.CursorType > 0) Then
ShipToCode.MoveFirst
Else
ShipToCode.Requery
End If
%>
</select>
</td>
<td>Addr 1</td>
<td>
<input type="text" name="textfield3" value="<%=(Addr1.Fields.Item("ShipToAddress1".Value)%>">
</td>
<td> </td>
</tr>
<tr>
<td>Item Number</td>
<td>
<select name="select3">
<%
While (NOT ItemNumber.EOF)
%>
<option value="<%=(ItemNumber.Fields.Item("ItemNumber".Value)%>" ><%=(ItemNumber.Fields.Item("ItemNumber".Value)%></option>
<%
ItemNumber.MoveNext()
Wend
If (ItemNumber.CursorType > 0) Then
ItemNumber.MoveFirst
Else
ItemNumber.Requery
End If
%>
</select>
</td>
<td>Addr 2</td>
<td>
<input type="text" name="textfield4" value="<%=(Addr2.Fields.Item("ShipToAddress2".Value)%>">
</td>
<td>
<input type="submit" name="Submit4" value="Exit">
</td>
</tr>
<tr>
<td>PO Number</td>
<td>
<input type="text" name="textfield" value="<%=(PONumber.Fields.Item("PONumber".Value)%>">
</td>
<td>City</td>
<td>
<input type="text" name="textfield5" value="<%=(City.Fields.Item("ShipToCity".Value)%>">
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>State</td>
<td>
<select name="select4">
<%
While (NOT States.EOF)
%>
<option value="<%=(States.Fields.Item("statename".Value)%>" ><%=(States.Fields.Item("statename".Value)%></option>
<%
States.MoveNext()
Wend
If (States.CursorType > 0) Then
States.MoveFirst
Else
States.Requery
End If
%>
</select>
</td>
<td> </td>
</tr>
</table>
</form>
<p> </p>
</div>
</body>
</html>
<%
Inquiry_1.Close()
%>
<%
ShipToCode.Close()
%>
<%
ItemNumber.Close()
%>
<%
City.Close()
%>
<%
States.Close()
%>
<%
PONumber.Close()
%>
<%
ShiptoName.Close()
%>
<%
Addr1.Close()
%>
<%
Addr2.Close()
%>
<%
Filter_Query.Close()
%>
I have several forms that I am having to create. The code that will be listed below is on the 1st form. The customer enters in information and click the submit button. When they do this it needs to query the database and give them an output of open sales orders.
I need to figure out how to get the submit button to do this and send it to another page.
****I AM STILL REAL NEW TO THSI SO ANY HELP IS WELCOMED****
If you need to see anything else let me know and I will get it to you.
**********HERE IS THE PAGE**************
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/WebCustomer.asp" -->
<%
set Inquiry_1 = Server.CreateObject("ADODB.Recordset"
Inquiry_1.ActiveConnection = MM_WebCustomer_STRING
Inquiry_1.Source = "SELECT Customer FROM open_so_inq"
Inquiry_1.CursorType = 0
Inquiry_1.CursorLocation = 2
Inquiry_1.LockType = 3
Inquiry_1.Open()
Inquiry_1_numRows = 0
%>
<%
set ShipToCode = Server.CreateObject("ADODB.Recordset"
ShipToCode.ActiveConnection = MM_WebCustomer_STRING
ShipToCode.Source = "SELECT ShipToCode FROM open_so_inq"
ShipToCode.CursorType = 0
ShipToCode.CursorLocation = 2
ShipToCode.LockType = 3
ShipToCode.Open()
ShipToCode_numRows = 0
%>
<%
set ItemNumber = Server.CreateObject("ADODB.Recordset"
ItemNumber.ActiveConnection = MM_WebCustomer_STRING
ItemNumber.Source = "SELECT ItemNumber FROM open_so_inq"
ItemNumber.CursorType = 0
ItemNumber.CursorLocation = 2
ItemNumber.LockType = 3
ItemNumber.Open()
ItemNumber_numRows = 0
%>
<%
set City = Server.CreateObject("ADODB.Recordset"
City.ActiveConnection = MM_WebCustomer_STRING
City.Source = "SELECT ShipToCity FROM open_so_inq"
City.CursorType = 0
City.CursorLocation = 2
City.LockType = 3
City.Open()
City_numRows = 0
%>
<%
set States = Server.CreateObject("ADODB.Recordset"
States.ActiveConnection = MM_WebCustomer_STRING
States.Source = "SELECT statename FROM states"
States.CursorType = 0
States.CursorLocation = 2
States.LockType = 3
States.Open()
States_numRows = 0
%>
<%
set PONumber = Server.CreateObject("ADODB.Recordset"
PONumber.ActiveConnection = MM_WebCustomer_STRING
PONumber.Source = "SELECT PONumber FROM open_so_inq"
PONumber.CursorType = 0
PONumber.CursorLocation = 2
PONumber.LockType = 3
PONumber.Open()
PONumber_numRows = 0
%>
<%
set ShiptoName = Server.CreateObject("ADODB.Recordset"
ShiptoName.ActiveConnection = MM_WebCustomer_STRING
ShiptoName.Source = "SELECT ShipToName FROM open_so_inq"
ShiptoName.CursorType = 0
ShiptoName.CursorLocation = 2
ShiptoName.LockType = 3
ShiptoName.Open()
ShiptoName_numRows = 0
%>
<%
set Addr1 = Server.CreateObject("ADODB.Recordset"
Addr1.ActiveConnection = MM_WebCustomer_STRING
Addr1.Source = "SELECT ShipToAddress1 FROM open_so_inq"
Addr1.CursorType = 0
Addr1.CursorLocation = 2
Addr1.LockType = 3
Addr1.Open()
Addr1_numRows = 0
%>
<%
set Addr2 = Server.CreateObject("ADODB.Recordset"
Addr2.ActiveConnection = MM_WebCustomer_STRING
Addr2.Source = "SELECT ShipToAddress2 FROM open_so_inq"
Addr2.CursorType = 0
Addr2.CursorLocation = 2
Addr2.LockType = 3
Addr2.Open()
Addr2_numRows = 0
%>
<%
set Filter_Query = Server.CreateObject("ADODB.Recordset"
Filter_Query.ActiveConnection = MM_WebCustomer_STRING
Filter_Query.Source = "SELECT * FROM open_so_inq"
Filter_Query.CursorType = 0
Filter_Query.CursorLocation = 2
Filter_Query.LockType = 3
Filter_Query.Open()
Filter_Query_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<div align="center">
<p><img src="Images/Nomus%20Logo%20.JPG" width="335" height="256"> </p>
<form method="post" action="">
<table width="668" border="0">
<tr>
<td>Customer</td>
<td>
<select name="select">
<%
While (NOT Inquiry_1.EOF)
%>
<option value="<%=(Inquiry_1.Fields.Item("Customer".Value)%>" ><%=(Inquiry_1.Fields.Item("Customer".Value)%></option>
<%
Inquiry_1.MoveNext()
Wend
If (Inquiry_1.CursorType > 0) Then
Inquiry_1.MoveFirst
Else
Inquiry_1.Requery
End If
%>
</select>
</td>
<td>Ship to Name</td>
<td>
<input type="text" name="textfield2" value="<%=(ShiptoName.Fields.Item("ShipToName".Value)%>">
</td>
<td>
<input type="submit" name="Submit" value="Filter">
</td>
</tr>
<tr>
<td>Ship To Code</td>
<td>
<select name="select2">
<%
While (NOT ShipToCode.EOF)
%>
<option value="<%=(ShipToCode.Fields.Item("ShipToCode".Value)%>" ><%=(ShipToCode.Fields.Item("ShipToCode".Value)%></option>
<%
ShipToCode.MoveNext()
Wend
If (ShipToCode.CursorType > 0) Then
ShipToCode.MoveFirst
Else
ShipToCode.Requery
End If
%>
</select>
</td>
<td>Addr 1</td>
<td>
<input type="text" name="textfield3" value="<%=(Addr1.Fields.Item("ShipToAddress1".Value)%>">
</td>
<td> </td>
</tr>
<tr>
<td>Item Number</td>
<td>
<select name="select3">
<%
While (NOT ItemNumber.EOF)
%>
<option value="<%=(ItemNumber.Fields.Item("ItemNumber".Value)%>" ><%=(ItemNumber.Fields.Item("ItemNumber".Value)%></option>
<%
ItemNumber.MoveNext()
Wend
If (ItemNumber.CursorType > 0) Then
ItemNumber.MoveFirst
Else
ItemNumber.Requery
End If
%>
</select>
</td>
<td>Addr 2</td>
<td>
<input type="text" name="textfield4" value="<%=(Addr2.Fields.Item("ShipToAddress2".Value)%>">
</td>
<td>
<input type="submit" name="Submit4" value="Exit">
</td>
</tr>
<tr>
<td>PO Number</td>
<td>
<input type="text" name="textfield" value="<%=(PONumber.Fields.Item("PONumber".Value)%>">
</td>
<td>City</td>
<td>
<input type="text" name="textfield5" value="<%=(City.Fields.Item("ShipToCity".Value)%>">
</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>State</td>
<td>
<select name="select4">
<%
While (NOT States.EOF)
%>
<option value="<%=(States.Fields.Item("statename".Value)%>" ><%=(States.Fields.Item("statename".Value)%></option>
<%
States.MoveNext()
Wend
If (States.CursorType > 0) Then
States.MoveFirst
Else
States.Requery
End If
%>
</select>
</td>
<td> </td>
</tr>
</table>
</form>
<p> </p>
</div>
</body>
</html>
<%
Inquiry_1.Close()
%>
<%
ShipToCode.Close()
%>
<%
ItemNumber.Close()
%>
<%
City.Close()
%>
<%
States.Close()
%>
<%
PONumber.Close()
%>
<%
ShiptoName.Close()
%>
<%
Addr1.Close()
%>
<%
Addr2.Close()
%>
<%
Filter_Query.Close()
%>