Database
  Home arrow Database arrow Exporting a MySQL Database to Excel Using ...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DATABASE

Exporting a MySQL Database to Excel Using ODBC
By: Codex-M
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2010-01-05

    Table of Contents:
  • Exporting a MySQL Database to Excel Using ODBC
  • How to install MySQL ODBC driver
  • How to add a MySQL database server to ODBC
  • Automatically exporting data from MySQL to MS Excel

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Exporting a MySQL Database to Excel Using ODBC


    (Page 1 of 4 )

    One of the most useful applications involves automatically transferring the data from a MySQL table to an MS Excel workbook. There are a number of ways to do this; some have disadvantages. This article will show you how to do it with the MySQL ODBC driver, one of the more efficient ways of moving the data.

    In a previous ASP Free article,  I discussed how to convert a MySQL database into an Excel workbook. The techniques discussed in that tutorial have the following disadvantages:  

    • If a developer exports a MySQL database into an Excel workbook using that technique, the data imported to the Excel workbook CANNOT be updated when the MySQL database is updated. There is no communication interface between MS Excel and the MySQL database. 

    • Exporting any MySQL database table to Excel is a lengthy process, since any developer will still need to log in to the MySQL database, click on Export, select options, download the file and then re-format the downloaded information to be compatible with an Excel workbook. If shortcuts can be made, especially when exporting several databases to their respective MS Excel workbooks, then it saves a lot of time and increases efficiency.

    The objective of this tutorial is to teach you how to retrieve all the data for an  entire MySQL table to an MS Excel workbook using the MySQL ODBC driver.

    What are ODBC driver and its requirements?

    We all know that MySQL is an open source database and is currently the most popular database used with websites. Because of this popularity, enormous applications are being developed. Microsoft Excel, being the most popular spreadsheet used for technical and business applications, needs a way to communicate with MySQL databases. Since MS Excel is proprietary and not open source, an API was developed by Microsoft in partnership with Simba Technologies. This API is called ODBC (Open Database Connectivity).

    The objective of ODBC is to let developers connect to open source databases like MySQL and fetch data to MS Excel. This application programming interface increases the efficiency of programmers working in both proprietary and open source database environments.

    MySQL ODBC is not included in the default installation of Windows XP (as of this writing, whether or not it is part of the default installation of Windows 7 was unknown). This tutorial has been tested using the Windows XP Home environment and MS Excel 2002. However, this would most likely to work also with newer Windows and office software (like Windows 7 and MS Excel 2007). The procedure discussed in this tutorial can be applied to them also, with minor variations.

    More Database Articles
    More By Codex-M


     

    DATABASE ARTICLES

    - Manage Projects with SQL Server Management S...
    - Query Editing and Regular Expressions with S...
    - Using SQL Server Management Studio Tools
    - SQL Server Management Studio
    - Exporting a MySQL Database to Excel Using OD...
    - Controlling Databases with SQL Server 2005 D...
    - Using Recovery Models with SQL Server 2005 D...
    - Handling Database Properties for the SQL Ser...
    - Managing Permissions with the SQL Server 200...
    - SQL Server 2005 Database Engine Security
    - Administering SQL Server 2005 Database Engine
    - Building Applications with Anonymous Types
    - A Closer Look at Anonymous Types
    - Programming with Anonymous Types
    - Converting Your Excel Worksheet into a Worki...





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 7 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek