View Single Post
  #2 (permalink)  
Old 09-28-2007, 07:18 PM
HelloWorld's Avatar
HelloWorld HelloWorld is offline
PT Admin
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: In front of computer...
Posts: 1,118
iTrader: (0)
HelloWorld is a jewel in the roughHelloWorld is a jewel in the roughHelloWorld is a jewel in the rough
I found this interesting code:

PHP Code:
<%@LANGUAGE="VBSCRIPT" %>
<%
    '
 Exporting A Table to Excel
    strConnection = "driver={MySQL ODBC 3.51 Driver};option=4;server=localhost;user=root;password=sorma;DATABASE=webstat;"
    set cn = server.createobject("adodb.connection")
    set rs = server.createobject("adodb.recordset")
    cn.open strConnection
    set rs = cn.execute("select statDate, visitors, unique_visitors from daily_visitors")

    response.ContentType = "application/vnd.ms-excel"
    response.AddHeader "Content-Disposition", "attachment; filename=excelfile.xls"
    response.Write("<table border=""1"">")
    do while not rs.eof
    response.Write("<tr>")
    response.Write("<td>" & rs("statDate") & "</td><td>" & rs("visitors") & "</td><td>" & rs("unique_visitors") & "</td></tr>" &  vbnewline )
    rs.movenext
    loop
    response.Write("</table>")
    cn.close
    set rs = nothing
%> 

__________________
PHP Code:
System.out.println("Hello World!"); 

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote