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

recordset problem 1

Status
Not open for further replies.

andreas57

Technical User
Sep 29, 2000
110
CH
i've got severel recordsets an wont to diplay them in a table i just dont no how. i've tried it this way but nothing happens, not even a error. has somebody got a idear. i wouls be very thankfull for help because it's my last problem to solve.

<table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;>

<%
Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
Set rs = sharknetc.execute(&quot;SELECT T_Email.email, T_Email.User, T_Email.Passwort, T_Email.von, T_Email.bis FROM T_Kunden INNER JOIN (T_Domain INNER JOIN T_Email ON T_Domain.[Domain-ID] = T_Email.[Domain-ID]) ON T_Kunden.[Kunden-ID] = T_Domain.[Kunden-id] WHERE T_Domain.Domain='&quot; & request.querystring(&quot;suchen&quot;) & &quot;'&quot;)

dim aremail
dim f
f=rs.recordcount
aremail=rs.getrows()
%>

<tr>
<td width=&quot;10%&quot; valign=&quot;top&quot;><!--mstheme--><font face=&quot;arial, Arial, Helvetica&quot;><font face=&quot;Arial&quot; size=&quot;1&quot;><br>
&nbsp;1.<br>
&nbsp;2.<br>
&nbsp;3.<br>
&nbsp;4.<br>
&nbsp;5.<br>
&nbsp;6.<br>
&nbsp;7.<br>
&nbsp;8.<br>
&nbsp;9.<br>
10.<br>
11.<br>
12.<br>
13.<br>
14.<br>
15.<br>
16.<br>
17.<br>
18.<br>
</td>

<td width=&quot;30%&quot; valign=&quot;top&quot;><!--mstheme--><font face=&quot;arial, Arial, Helvetica&quot;><font face=&quot;Arial&quot; size=&quot;1&quot;><strong>Email:</strong><br><br>
<% for i = 0 to f
i = i+1 %>
<font COLOR=&quot;#000000&quot;><%=aremail(i,1)%></font><br>
<% next %>
</td>

<td width=&quot;30%&quot; valign=&quot;top&quot;><!--mstheme--><font face=&quot;arial, Arial, Helvetica&quot;><font face=&quot;Arial&quot; size=&quot;1&quot;><strong>User:</strong><br><br>
<% for g = 0 to f
i = g+1 %>
<font COLOR=&quot;#000000&quot;><%=aremail(g,2)%></font><br>
<% next %>
</td>

<td width=&quot;30%&quot; valign=&quot;top&quot;><!--mstheme--><font face=&quot;arial, Arial, Helvetica&quot;><font face=&quot;Arial&quot; size=&quot;1&quot;><strong>Passwort:</strong><br><br>
<% for h = 0 to f
i = h+1 %>
<font COLOR=&quot;#000000&quot;><%=aremail(h,3)%></font><br>
<% next %>
</td></tr>

</table> <font face=&quot;arial, Arial, Helvetica&quot;> [sig]<p>andreas owen<br><a href=mailto:aowen@swissonline.ch>aowen@swissonline.ch</a><br>[/sig]
 
Andreas,

1. You don't have a connection established before you try to invoke the recordset.
2. For legibility, use response.write instead of moving in and out of asp within your for-next loops.
3. take a look at this pseudo code...

Code:
<%
 open your connection
 open your recordset
 query your recordset
 Dim numFields
 numFields = rs.fields.count -1

 response.write &quot;<table border=1>&quot;
 Do while not rs.eof
  response.write &quot;<tr>&quot;
  for i = 0 numFields
   response.write &quot;<td>&quot; & rs(i) & &quot;</td>&quot;
  next i
  response.write &quot;</tr>&quot;
 Loop
 response.write &quot;</table>&quot;
%>

There is a lot you can do that I didn't show you.  Take a look at [URL unfurl="true"]http://www.able-consulting.com/ADO_Faq.htm[/URL] and [URL unfurl="true"]http://msdn.microsoft.com/library/periodic/period99/sa99h17.htm[/URL] for more info on using asp with databases. You'll learn about keysets, cursors, and connection types.

Hope it helps, [sig]<p>Rob<br><a href=mailto:robschultz@yahoo.com>robschultz@yahoo.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
"Focus on the solution to the problem,<br>
    not the obstacles in the way."<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top