Results 1 to 3 of 3

Thread: Excel to MySQL

  1. #1
    Join Date
    Oct 2005

    Unanswered: Excel to MySQL

    Hi Guys,

    I want to transfer data from excel and dump it in MySql using VB.

    (1) Is this possible (2) Is this a difficult process (3) Any one may have sample code they can share

    Please help me out here.



  2. #2
    Join Date
    Apr 2005
    Baltimore, MD
    Without VB, you would just export the excel file to a csv file and read it into MySQL.

    It's been a while since I've used VB, but if you can open a datasource via ODBC (which I think you can), this can probably be done pretty easily.

  3. #3
    Join Date
    Feb 2006
    Use OLEDB to connect to the excel.
    Connection string:
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""

    "HDR=Yes;" indicates that the first row contains columnnames, not data
    "IMEX=1;" tells the driver to always read "intermixed" data columns as text

    "SELECT * FROM [sheet1$]"
    The worksheet name should be followed by a $
    You can then read from the excel (as from a table ) using a recordset
    and push the data into the required destination.
    I hope this might help you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts