MySQL connection

Discussion in 'Site Programming, Development and Design' started by Tamaas, Jan 29, 2014.

  1. A similar issue like others had, but I did not find a solution in other discussions. I have trouble connecting from my .NET page to my MySQL database.

    I get this error:
    [COMException (0x80004005): [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.]

    My List of SQL DSN:
    Data Source NameSQL Server
    DSN_needleno_Needlemy02.Winhost.com

    I use Javascript connection string:
    Application("app_connection_string") = "Data Source=DSN_needleno_Needle; Initial Catalog=mysql_70130_needle; port=3306; User Id=XX; Password=XX;";
    var site_connectionstring = "app_connection_string";
    var conn = Server.CreateObject("ADODB.Connection");
    conn.Open(Application.Contents(site_connectionstring));

    I have no problem logging in to the database using the MySQL Workbench:
    Hostname: my02.Winhost.com
    Port: 3306
    Username: XX
    Password: XX
    Default Schema: mysql_70130_needle

    Did I miss something? do I have to set up access somewhere?

    Thanks a lot!
     
    Last edited by a moderator: Oct 14, 2015
  2. Elshadriel

    Elshadriel Winhost Staff

    You're using the Microsoft SQL Server drivers, not MySQL. I'm not sure if there is a MySQL ODBC driver, and I don't think we offer sample code to code via ASP. You can connect using .NET though.
     
  3. Thanks for the reply. How can I connect through .NET? You have sample code for that? Thanks again.
     
  4. Elshadriel

    Elshadriel Winhost Staff

    Sorry, I don't have any sample code offhand, but you might want to take a look at this blog. The first half of it shows you how to connect to a MySQL database.
     
    Last edited by a moderator: Oct 14, 2015
    Michael likes this.

Share This Page