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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

added or displaying 2 Arrays (RS, RS1 problem) as 1

Status
Not open for further replies.

davefm1

Programmer
Apr 18, 2001
78
US
Hi guys ;
I'm having a problem with 2 arrays, one Sybase procedure two calls with different ntds. The procedure has 40 selects in them. On the 9 and 16 selects return two values. All other selects return 1 value only. I Am getting back data till I reach ( rvalue) then I only the field before that again ( short_name) then I get zeros for the rest of the selects .
How do I get around this .
Thanks.

<%
If (request(“ntds”)=”ALL then
ntds = &quot;MAIN&quot;

set Conn=Server.CreateObject(&quot;ADODB.Connection&quot;)
set RS=Server.CreateObject(&quot;ADODB.recordset&quot;)
Conn.Open(Application(&quot;ConnString&quot;))

If ntds=”MAIN”
set RS1 = Conn.Execute(&quot;exec jones..rpt_work_summary '&quot; & ntds & &quot;'&quot;)

myIndex1 = 0
do while (not RS1.EOF)
myArray3(myIndex1) = CStr(RS1(0))
myIndex1 = myIndex1 + 1
do while (not RS1.eof)
'Response.Write(&quot;<tr><td>  &quot; & RS1(0) & &quot;</td><td>&quot; & RS1(1) & &quot;</td></tr>&quot;)
RS1.MoveNext()
loop

set RS1 = RS1.NextRecordset()
loop

myIndex1 = 0
ntds= ” ”
ntds = &quot;SUBCONTRACT&quot;

set RS = Conn.Execute(&quot;exec jones..rpt_work_summary '&quot; & ntds & &quot;'&quot;)
myIndex = 0

do while (not RS.EOF)

myArray4(myIndex) = CStr(RS(0))
myIndex = myIndex + 1
do while (not RS.eof)
'Response.Write(&quot;<tr><td>  &quot; & RS1(0) & &quot;</td><td>&quot; & RS1(1) & &quot;</td></tr>&quot;)
RS.MoveNext()
loop
set RS = RS.NextRecordset()

loop
myIndex1 = 0
Response.Write(&quot;<table width=100% border=1 cellspacing=0 cellpadding=2 width=100% align=LEFT>&quot;)

Function ReportAllConts()

‘ This is where I name the const I have forty of them all reture 1 value exept 2. The numbers are the select number these fields come from in the sql procedure.

const short_name = 9
const rvalue = 9
const short_name =16
const rvalue = 16

‘ Then I have forty different (response .write)

Response.Write(&quot;<tr><td>&quot; & myArray3( short_name)& “</td><td>” & myArray4 ( rvalue) & &quot;</td></tr>&quot;)

Response.Write(&quot;<td>&quot; & Cint(myArray3(last_shipped_amount)) + Cint(myArray4(last_shipped_amount)) & &quot;</td></tr>&quot;)

End Function
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top