•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 422,420 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 5,222 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 603 | Replies: 0
![]() |
•
•
Join Date: Jun 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
ASP Syntax (Toggle Plain Text)
<html> <title>CodeAve.com(Create Excel on Server)</title> <body bgcolor="#FFFFFF"> <% accessdb="a" cn="DRIVER=Microsoft Access Driver (*.mdb)};" cn=cn & "DBQ=" & server.mappath(accessdb) Set rs = Server.CreateObject("ADODB.Recordset") sql = "select id,empname,phone from empp" rs.Open sql,cn rs.MoveFirst file_being_created= "states.xls" set fso = createobject("scripting.filesystemobject") Set act = fso.CreateTextFile(server.mappath(file_being_created), true) act.WriteLine("<html><body>") act.WriteLine("<table border=""1"">") act.WriteLine("<tr>") act.WriteLine("<th nowrap>id</th>") act.WriteLine("<th nowrap>empname</th>") act.WriteLine("<th nowrap>phone</th>") act.WriteLine("</tr>") for documents= 1 to 3 Act.WriteLine("<tr>") act.WriteLine("<td align=""right"">" & rs("id") & "</td>" ) act.WriteLine("<td align=""right"">" & rs("empname") & "</td>" ) act.WriteLine("<td align=""right"">" & rs("phone") & "</td>") act.WriteLine("</tr>") rs.movenext next act.WriteLine("</table></body></html>") act.close response.write "<a href='states.xls'>States</a> (.xls) has been created on " & now() & "<br>" %> </body> </html>
I tryed this code but its shows error like
Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /r.asp, line 20
Please help me
Last edited by peter_budo : Jun 4th, 2008 at 3:26 am. Reason: Keep It Organized - please use [code] tags
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
activation advice ajax api asp blogging blogs business code crash daniweb data data protection database debugging development doubleclick encryption europe forensic forensics google hard hardware help innovation internet key linux mail microsoft news office privacy product programming qmail security serial server smtp software source sql storage tags vista web windows xml
- Previous Thread: alter table add column through Dreamweaver ... need to get this to work ASAP! :(
- Next Thread: How to anchor TreeView Control in Web Browser


Linear Mode