-
Looping thru results like an array
Running Classic ASPdb.
I execute ASPdb and get 900+ records returned. I want to export each record to a session variable and loop thru each item so they are displayed all at once (with no further user interaction)
Does the data get stored in an array I can loop thru?
Quick example:
<%
Set MyDb = Server.CreateObject("Asp.DB")
MyDb.dbDSN = "DSN=database"
MyDb.dbDBType="SQL"
MyDb.dbUnit = 1
MyDb.dbSQL = "Select * from SRS_AGENCY_REGIONS_VIEW"
MyDb.dbDisplay = "false"
MyDb.dbExportFlds = "0,1,2,3,4,5,6,7,11,13,14"
Mydb.ASPdb
' here is where I want to loop thru the results and display them all at once
%>
Field1: <%=session("aspdb_1_REGION")%><br>
Field2: <%=session("aspdb_1_ADDRESS")%><br><hr>
Can I do something like:
<% for x = 1 to MyDb.dbRecordCount %>
Field1: <% =session("aspdb_1_REGION")[x] %><br>
Field2: <% =session("aspdb_1_ADDRESS")[x] %><br><hr>
<% next %>
Output would look like this:
Field1: USA
Field2: 123 Anywhere street
-------------------------
Field1: Canada
Field2: 123 Canadian Lane
-------------------------
etc etc
--- Ashley
-
I thin you meant you got the 900 records and you want to display them in your own way and thatis why you want to ? Can you use the user template to do that?
Frank
-
Originally Posted by Frank
I thin you meant you got the 900 records and you want to display them in your own way and thatis why you want to ? Can you use the user template to do that?
Frank
Yes, I want to display them in a custom layout. Where do I find more about the user template for ASPdb Pro?
-
download all the classic examples and look at the user templates exaple. UPgrade to DotNet and yo ucan get more updated support.
Frank
-
Th etemplate features is not in the classic pro version. In ASP-db.Net versions, this is done like a repeater. Check the repeater samples and hope you can catch up with the DotNet versions.
Frank
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|