Hi
I have a stored procedure that queries a database table and returns variables. these variables are used to create a html email sent via sp_OACreate. The problem I have is that I have 1 reference number and multiple results.

I can create an asp page using this code

<%sql = "HC_Applicationi "&varref
rs.open sql,strconnect
if rs.eof then
varnam = "<tr><td colspan='4'><div align='center'><font color='red'>No Family members found please</font></div></td></tr>"
else
while not rs.eof%>

<tr>
<td><%=rs("firstname")%>&nbsp;<%=rs("surname")%> </td>
<td><%=rs("dob")%></td>
<td><%if rs("quote") <> 0 then
response.write("&pound;"&FormatNumber(rs("quote")) )
else
response.write("F.O.C.")
end if
totquo = totquo + rs("quote")%></td>
</tr>
<tr>
</tr>
<%rs.movenext
wend
end if
rs.close%>

Could someone please help me with the correct formatting to translate the above code so that it can be inserted into the following

' <TD colspan="2"><FONT size=2><b>Additional Family Members</b>'+

'<table width="100%" border="0" cellspacing="2" cellpadding="0">'+
' <tr>'+
'<td><FONT size=2><b>Name</b></td>'+
'<td><FONT size=2><b>Date of Birth </b></td>'+
'<td><FONT size=2><b>Quotation</b></td>'+
--'<td><FONT size=2><b>id</b></td>'+
'<tr>'+
'<td><FONT size=2>'+@varfirn+' '+@varsurn+'</td>'+
'<td><FONT size=2>'+@vardobn+' </td>'+
'<td><FONT size=2>'+STR(@varquotm,7,2)+' </td>'+
--'<td><FONT size=2>'+@varid+' </td>'+
'<tr>'+
'<tr>'+
'<td><FONT size=2>'+@varfirn+' '+@varsurn+'</td>'+
'<td><FONT size=2>'+@vardobn+' </td>'+
'<td><FONT size=2>'+STR(@varquotm,7,2)+' </td>'+
--'<td><FONT size=2>'+@varid+' </td>'+
'<tr>'+
'</table>'

Thanks