Tips Station Asp.net Article Seo Articles
Tutorials Code Samples
›  Home
›  Mission
›  About us
›  Contact Us
›  Feedback
›  Terms & Condition
Asp Articles
IT Solutions
 
› ASP.NET

› Programming Tips

› Ajax

› Asp

› ADO.NET

› Databases

› SEO

› CSS And Designing

› Php

 
Most Viewed Articles
 
› Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

› Change theme dynamically without page refresh in ASP.NET

› Install AJAX On Machines Running Visual Studio 2005

› Creating Pretty Popups Using AJAX

› Simple ASP Image Resize Function

› SQL Server Performance Counters

› ASP.Net Interview Questions And Their Answers

› Encode Url using ASP

› Difference Between DataGrid and GridView in Asp.Net

› Select Specific Value WithIn Drop Down List Or Radio Button List

more...
 
 
Home> Programming Tips
 
Display records from Microsoft Excel in ASP
 
Aim of this articles is to display records from an Microsoft Excel in an ASP. We could use general SQL command while retreving data from an excel sheet. All we need to know how to connect Excel file.

Here is the excel database connection string :

Connection String for Excel


strConnection = "DBQ=" & Server.MapPath("customer-list.xls") & "; DRIVER={Microsoft Excel Driver (*.xls)};"

We will use a specific driver to connect to Excel files. ODBC plays a major role in coding.

An Example :


strConnection = "DBQ=" & Server.MapPath("customer-list.xls") & "; DRIVER={Microsoft Excel Driver (*.xls)};"

Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
cn.open strConnection


sql="select * from sales_in_2005;"

rs.Open sql, cn, adOpenStatic, adLockPessimistic


do while not rs.eof
    response.write rs("customerName") & " : " & rs("soldPrice") & "<br/>"
rs.movenext
loop


rs.close
Set rs = nothing
cn.close
Set cn = nothing



In this example, we have used an example Excel files that holds some data containing customerName and soldPrice cells. We have displayed all cells with sample data on our page.

Happy Coding
 
 
Vrp Technologies
 
Serversea Hosting
 
 
Latest Articles
 
› Sending SMS With PHP

› MySQL Join Tutorial

› Make An RSS Feed Using PHP

› Intro To Object: Option Variables

› Design An Online Chat Room With PHP And MySQL

› Create Tell A Friend Script With HTML & PHP

› Benchmark And Optimize PHP Script Speed

› What Kind of DBA Are You?

› SQL Server Performance Counters

› SQL Server Performance Tips

more...
 
Random Articles
 
› Application Object in Asp

› Displaying Data using ASP.NET 2.0 Repeater

› Cache Data within your Application - Asp.Net

› Ajax - The Basics

› Storing and Retrieving Variables From Application Object - Asp

› Create Tell A Friend Script With HTML & PHP

› Create an RSS Feed in Asp.net

› Browser Detection in ASP

› Install AJAX On Machines Running Visual Studio 2005

› Understanding DDL Triggers In SQL Server 2005

more...
 
Home Mission About us Contact us Feedback Terms Conditions
2008 © Copyright TipsStation. All rights reserved.