Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unable to query multiple records

Status
Not open for further replies.

leon2

Technical User
Jan 18, 2001
6
US
hi,

I was new in asp programming, i facing some problem with my asp script. How could i display the multiple records on my display table? Below is my form asp page:

ship_inventory.asp
------------------------------------------
<html>

<body marginwidth=&quot;0&quot; marginheight=&quot;0&quot; leftmargin=&quot;0&quot; topmargin=&quot;0&quot; background=&quot;../_themes/spokes/spotxtr.gif&quot;>

<script>

function populate(inForm)
{
document.myform.addlist.options[document.myform.addlist.options.length]=new Option(document.myform.shipno.value,document.myform.shipno.value)
}

</script>

<center>
<p>
<hr>

<h3>Ship Inventory

<br>

<form name=myform action=&quot;shipno1.asp&quot; method=post>
<table border=1 cellpadding=4>
<tr><td>shipno input :
<td><input type=text name=shipno size=30 maxlength=15>
<tr>
<td>shipno added:
<td><select name=addlist multiple>
</select>
<input type=button value=&quot;add&quot; onClick=&quot;populate(this.form)&quot;>
</table>
<br>
<input type=submit value=Display>
<input type=reset value=reset>
</form></center>


</body>
</html>
---------------------------------------------------------
for example:- I have 6 shipment number already added into listbox. After query complete i want this 6 shipment number
at the same time display on the display table include all
it's fields and records. Below is my asp query page:

shipno1.asp
---------------------------------------------------------
<%

shipid = request(&quot;addlist&quot;)

set cn = server.createobject(&quot;adodb.connection&quot;)

cn.open &quot;Provider=MSDAORA.1;Password=developergrp;User ID=yts;Data Source=mtfdb;Persist Security Info=True;&quot;


set rs = cn.execute(&quot;select shipno,partno,product,remark||wafer remark,qty00,qty01,mtfno from mtfmaster &quot; &amp; _
&quot;where shipno='&quot; &amp; shipid &amp; &quot;'&quot; &amp; _
&quot;order by shipno,partno,remark&quot;)

%>

<html>
<body marginwidth=&quot;0&quot; marginheight=&quot;0&quot; leftmargin=&quot;0&quot; topmargin=&quot;0&quot; background=&quot;../_themes/spokes/spotxtr.gif&quot;>
<p>
<HR>
<H3><center>Result List</center></H3>
<BR>
<center><a href=&quot; to ship inventory</a></center>
<br>

<%

if shipid=&quot;&quot; then


Response.Write &quot;<center>&quot; &amp; &quot;<h4>&quot; &amp; &quot;Shipno required. View cannot continue.&quot; &amp; &quot;</center>&quot;
Response.End
end if

if len(shipid)<8 then

Response.Write &quot;<center>&quot; &amp; &quot;<h4>&quot; &amp; &quot;shipno must be at least 8 number!&quot; &amp; &quot;</center>&quot;
Response.End

end if


if len(shipid)>8 then

Response.Write &quot;<center>&quot; &amp; &quot;<h4>&quot; &amp; &quot;shipno must be at least 8 number!&quot; &amp; &quot;</center>&quot;
Response.End

end if

if not isnumeric(shipid) then
Response.Write &quot;<center>&quot; &amp; &quot;<h4>&quot; &amp; &quot;shipno must be a number.&quot; &amp; &quot;</center>&quot;
Response.End

end if
%>


<%
if rs.eof then

Response.Write &quot;<center>&quot; &amp; &quot;<h4>&quot; &amp; &quot;<font color=red>no data found&quot;
Response.End


end if

%>
<center><TABLE BORDER=1 CELLPADDING=4>
<tr>
<TD>shipno
<TD>partno
<td>desc.
<td>w/code
<td>qty00
<td>qty01
<td>mtfno
<tr>

<%

do until rs.eof


Response.Write &quot;<tr>&quot;
Response.Write &quot;<td>&quot; &amp; rs(&quot;shipno&quot;)
Response.Write &quot;<td>&quot; &amp; rs(&quot;partno&quot;)
Response.Write &quot;<td>&quot; &amp; rs(&quot;product&quot;)
Response.write &quot;<td>&quot; &amp; rs(&quot;remark&quot;)
Response.write &quot;<td>&quot; &amp; rs(&quot;qty00&quot;)
Response.write &quot;<td>&quot; &amp; rs(&quot;qty01&quot;)
Response.Write &quot;<td>&quot; &amp; rs(&quot;mtfno&quot;)

rs.movenext



loop


%>

</table>

<%

response.write &quot;<h4>&quot; &amp; &quot;Done&quot;

%>

</body>
</html>
<%
rs.close
cn.close
set rs=nothing
set cn=nothing
%>
-------------------------------------------------------
so, how do i write the script to call out this fucntion?

can somebody help me!!


thanks for person would help me out on this problem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top