|
| |
|
|
westy
Posts: 54 From: UK Status: offline
|
Array and DRW - 4/29/2004 12:12:35
Does any one know if i can use a loop around a DRW and pass it variables from the an array? here is some code <p> <% for each infoloop in CPFIN - 1 response.write(pfinarray(infoloop)) Data1 = pfinarray(infoloop) response.write ("Hello ") & (infoloop) & (" ")& (Data1) %> <br> <!--#include file="../_fpclass/fpdblib.inc"--> <% fp_sQry="SELECT [Stockcodes].[MatchCode] FROM Stockcodes WHERE ((([Stockcodes].[pfinish])= '"& Data1 & "')) GROUP BY [Stockcodes].[MatchCode]; " fp_sDefault="" fp_sNoRecords="<tr><td colspan=1 align=left width=""100%"">No records returned.</td></tr>" fp_sDataConn="conversion2b" fp_iMaxRecords=0 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=True fp_fMenuFormat=False fp_sMenuChoice="MatchCode" fp_sMenuValue="MatchCode" fp_iDisplayCols=1 fp_fCustomQuery=True BOTID=2 fp_iRegion=BOTID %> <!--#include file="../_fpclass/fpdbrgn1.inc"--> <% Count1 = Count1 + 1%> <!--#include file="../_fpclass/fpdbrgn2.inc"--> <!--#include file="../_fpclass/fpdblib.inc"--> <% fp_sQry="SELECT Stockcodes.Matchcode FROM Stockcodes WHERE (((Stockcodes.pfinish)= '"& Data1 & "')); " fp_sDefault="" fp_sNoRecords="<tr><td colspan=1 align=left width=""100%"">No records returned.</td></tr>" fp_sDataConn="conversion2b" fp_iMaxRecords=0 fp_iCommandType=1 fp_iPageSize=0 fp_fTableFormat=True fp_fMenuFormat=False fp_sMenuChoice="MatchCode" fp_sMenuValue="MatchCode" fp_iDisplayCols=1 fp_fCustomQuery=True BOTID=1 fp_iRegion=BOTID %> <!--#include file="../_fpclass/fpdbrgn1.inc"--> <% Count2 = Count2 + 1%> <!--#include file="../_fpclass/fpdbrgn2.inc"--> <p>For this selection there are <b> <%response.write(Count2)%> </b> records within which there are <b> <%response.write(Count1)%> unique Matchcodes </p> <% 'infoloop = infoloop + 1 next %> I have tried Do and loop and For Each Next and keep comming up with the same error. i have tried removing the DB bit and adding a text write statement so i know the loop works . I have tried setting the loop to one value and then the DB bit works so i know it passes values to the DB stuff. Why won't both elements work together? the error is Error Type: Microsoft VBScript compilation (0x800A03EA) Syntax error /matchcode/_fpclass/fpdblib.inc, line 3 Any toughts ? other ways to do it?
_____________________________
WESTY
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Array and DRW - 4/29/2004 12:18:48
quote:
<p> <% for each infoloop in CPFIN - 1 response.write(pfinarray(infoloop)) If this is the full page, the array 'pfinarray' has never been defined. Is it defined earlier on the page? Are you getting anything out for that response.write?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
westy
Posts: 54 From: UK Status: offline
|
RE: Array and DRW - 4/29/2004 12:28:45
hi Cheers for the Dim array stuff, (Other post) trying a different way but his the next problem. the pfinArray has data entered above it. if i change the loop to <p> <% infoloop = 4 'do while infoloop < countpfin response.write(pfinArray(infoloop)) Data1 = pfinArray(infoloop) response.write ("Hello ") & (infoloop) & (" ")& (Data1) %> <br> and loose the loop at the end then i get DimHello 4 Dim For this selection there are 501 records within which there are 28 unique Matchcodes Which is coorrect, (except the debug stuff) But i want to loop through this many times. Confused I am.....
_____________________________
WESTY
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|