+ Reply to Thread
Results 1 to 4 of 4

Excel and MySQL

  1. #1
    Registered User
    Join Date
    02-07-2006
    Posts
    26

    Excel and MySQL

    Hi everyone, I'm trying to connect an excel worksheet with a MySQL Database. I already know how to connect to an Access but now I have to change the database.
    I will thank you all if someone could give me a short example (or a link to one) about connecting to MySQL and retrieve information.

    Regards.
    Daniel.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Daniel,

    This link should provide you with all the information you need about choosing the correct connection string for your application of MySQL.

    http://www.connectionstrings.com/?carrier=mysql

    Here is another link for connection information to various database servers, files, etc.

    http://www.connectionstrings.com/

    Sincerely,
    Leith Ross
    Last edited by Leith Ross; 05-22-2008 at 04:12 PM.

  3. #3
    Registered User
    Join Date
    02-07-2006
    Posts
    26
    Leith, many thanks for the links. But actually I'm looking for a complete example, nothing so extensive, just a few lines with the connection code because I cannot solve how to do it.

    Many thanks to all.
    Daniel.

  4. #4
    Registered User
    Join Date
    11-05-2008
    Location
    Indiana
    Posts
    2
    Here is working code I use. Just insert your specific data where I have (#ENTER_????#)

    With Selection.QueryTable
    .Connection = Array(Array( _
    "ODBC;DSN=#ENTER_DSN#;DESC=MySQL ODBC 3.51 Driver DSN;DATABASE=#ENTER_DATABASE_NAME#;SERVER=#ENTER SERVER URL OR IP#;UID=#ENTER USERNAME#;PASSWORD=#ENTER PASSWORD#;PORT=3306;OPTIO" _
    ), Array("N=3;STMT=;"))
    .Sql = Array(#ENTER NAME OF STRING CONTAINING QUERY STATEMENT#)
    .Refresh False
    End With

    Enjoy!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1