Hi,
I have the below coding but it’s only displaying the data not saving it to excel I guess I have a problem with my coding please help me …
<HTML>
<HEAD>
<TITLE>Telex Transfer</TITLE>
<%
'response.setContentType "application/excel.xls"
'response.setHeader("Content-Disposition","filename=book1.xls"
set conn = Server.CreateObject("ADODB.CONNECTION"
set qryrs = Server.CreateObject("ADODB.RECORDSET"
conn.open "DSN=OPP; UID= “”; Password=”;"
SQL= "select ReferenceNo, ValueDate, Currency, Amount, Narration from msgmain"
set qryrs = conn.execute(SQL)
%>
</HEAD>
<BODY>
<form name="">
<table border=0 cellpadding=0 cellspacing=0 bordercolor=black style="width:100%">
<tr>
<td>ReferenceNo</td>
<td>ValueDate</td>
<td>Currency</td>
<td>Amount</td>
<td>Narration</td>
</tr>
<%While Not qryrs.eof%>
<tr>
<td><%=qryrs("ReferenceNo"
%></td>
<td><%=qryrs("ValueDate"
%></td>
<td><%=qryrs("Currency"
%></td>
<td><%=qryrs("Amount"
%></td>
<td><%=qryrs("Narration"
%></td>
</tr>
<%qryrs.MoveNext
Wend%>
</table>
<%
qryrs.close
conn.close%>
</form>
</BODY>
</HTML>
I have the below coding but it’s only displaying the data not saving it to excel I guess I have a problem with my coding please help me …
<HTML>
<HEAD>
<TITLE>Telex Transfer</TITLE>
<%
'response.setContentType "application/excel.xls"
'response.setHeader("Content-Disposition","filename=book1.xls"
set conn = Server.CreateObject("ADODB.CONNECTION"
set qryrs = Server.CreateObject("ADODB.RECORDSET"
conn.open "DSN=OPP; UID= “”; Password=”;"
SQL= "select ReferenceNo, ValueDate, Currency, Amount, Narration from msgmain"
set qryrs = conn.execute(SQL)
%>
</HEAD>
<BODY>
<form name="">
<table border=0 cellpadding=0 cellspacing=0 bordercolor=black style="width:100%">
<tr>
<td>ReferenceNo</td>
<td>ValueDate</td>
<td>Currency</td>
<td>Amount</td>
<td>Narration</td>
</tr>
<%While Not qryrs.eof%>
<tr>
<td><%=qryrs("ReferenceNo"
<td><%=qryrs("ValueDate"
<td><%=qryrs("Currency"
<td><%=qryrs("Amount"
<td><%=qryrs("Narration"
</tr>
<%qryrs.MoveNext
Wend%>
</table>
<%
qryrs.close
conn.close%>
</form>
</BODY>
</HTML>