excel|odbc| data flutter and 8/30/2001 4:52:49 PM add in Joy asp← return suites:
Example:
There is an Excel table book1.xsl in "C:\excel\book1.xls", and the table is structured as follows:
1 Ordinal name Amount
2 1 Sheets 3,100
3 2 Lee 4,200
4 3 King 5,300
The ordinal field is not empty
Note: The Excel start line is 1 instead of 0
<% @language =vbscript%>
<%
Set xlapp = server. CreateObject ("Excel.Application")
strsource = "C:\excel\book1.xls"
Set xlbook = XlApp.Workbooks.Open (strsource)
Set xlsheet = xlbook. Worksheets (1)
I=1
Response.Write "<table cellpadding=0 cellspacing=0 border=1 width=500>"
While Xlsheet.cells (i,1) <> ""
Response.Write "<tr>"
Response.Write "<td height=20 align=center width=100>" & Xlsheet. Cells (i, 1) & "</td>"
Response.Write "<td height=20 align=center width=200>" & Xlsheet. Cells (i, 2) & "</td>"
Response.Write "<td height=20 align=center width=200>" & Xlsheet. Cells (i, 3) & "</td>"
Response.Write "</tr>"
I=i+1
Wend
Response.Write "</table>"
Set xlsheet=nothing
Set xlbook=nothing
xlApp.Quit ' Remember to add this, or you will add an Excel process to your machine every time you run it, and you cannot release it. I've tried "set
Xlapp=nothing "is not going to work.
%>