Re: mySQL Connection String

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Turkbear (noone_at_nowhere.com)
Date: 06/22/04


Date: Tue, 22 Jun 2004 11:44:27 -0500

On Tue, 22 Jun 2004 14:24:21 GMT, jeff.nospam@zina.com (Jeff Cochran) wrote:

>On Tue, 22 Jun 2004 00:49:03 +0800, "IPT" <chency@streamyx.com> wrote:
>
>>I use mySQL but can connect.
>>
>>Here is my code:
>>Set myconn = Server.CreateObject("ADODB.Connection")
>>myconn.Open "ODBC; Driver=Sybase SQL Anywhere 5.0;" & _
>> "DefaultDir=c:\inetpub\dbase\;" & _
>> "Dbf=c:\inetpub\dbase\mydb.db;" & _
>> "Uid=dba;" & _
>> "Pwd=sql;" & _
>> "Dsn="""""
>>Set rs = Server.CreateObject("ADODB.Recordset")
>>
>>I get error message:
>>Microsoft OLE DB Provider for ODBC Drivers error '80004005'
>>
>>[Microsoft][ODBC Driver Manager] Data source name not found and no default
>>driver specified
>>
>>I refered to
>>http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm#ODBCDriverForSybaseSQLAnywhere.
>
>You say you can't connect to a MySQL database using the ODBC driver
>for a Sybase database? I guess everything is acting as expected then.
>
>Hint: When you look at a site for a connection string, picking a link
>at random rarely works. Selecting the one for the database you use,
>and modifying it according to your specific server setup, usually
>does.
>
>So, using MySQL, I'd think you'd have better luck with:
>
>http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForMySQL
>
>Data Source, User ID and Password will need to be edited for your
>specifc setup.
>
>Jeff
Actually it was the right site just wrong driver info:

Here's wht was given about MySql:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ODBC Driver for MySQL (via MyODBC)
To connect to a local database (using MyODBC Driver)

oConn.Open "Driver={mySQL};" & _
           "Server=MyServerName;" & _
           "Option=16834;" & _
           "Database=mydb"
To connect to a remote database

oConn.Open "Driver={mySQL};" & _
           "Server=db1.database.com;" & _
           "Port=3306;" & _
           "Option=131072;" & _
           "Stmt=;" & _
           "Database=mydb;" & _
           "Uid=myUsername;" & _
           "Pwd=myPassword"
To connect to a local database (using MySQL ODBC 3.51 Driver)

oConn.Open "DRIVER={MySQL ODBC 3.51 Driver};" & _
                 "Server=myServerName;" & _
                 "Port=3306;" & _
                 "Option=16384;" & _
                 "Stmt=;" & _
                 "Database=mydatabaseName;" & _
                 "Uid=myUsername;" & _
                 "Pwd=myPassword"
Or
oConn.Open "DRIVER={MySQL ODBC 3.51 Driver};" & _
                 "SERVER=myServerName;" & _
                 "DATABASE=myDatabaseName;" & _
                 "USER=myUsername;" & _
                 "PASSWORD=myPassword;"

Note: When you first install MySQL, it creates a "root" user account (in the sys datbase's user table) with a blank
password.

For more information, see: Programs Known to Work with MyODBC

--------------------------------------------------------------------------------

Hope it helps..



Relevant Pages

  • Re: resultset is an iterator?
    ... >> done by the JDBC driver and the database backend. ... >> drag it all into memory but I have noticed that MySQL seems to do this. ... ResultSets are completely retrieved and stored in memory. ...
    (comp.lang.java.databases)
  • Re: MySQL JDBC driver - implications for non-GPLed apps
    ... >> driver a particular user wants to implement. ... MySQL AB does not purport to be our ... > care to provide a clear-cut explanation as part of their license agreement. ... >> However then you look at it, is the value of the driver and database ...
    (comp.lang.java.databases)
  • Re: Project 2000 to mySQL Database
    ... I recall people having trouble with the Oracle ODBC driver and having to use ... It would not be surprising to see that the mySQL driver does not work ... > ODBC database should work. ... >>> of SQL Server I should obtain? ...
    (microsoft.public.project.vba)
  • Re: MySQL JDBC driver - implications for non-GPLed apps
    ... > closed-sourced application that makes use of the GPLed MySQL JDBC driver? ... > another database by using its driver makes the entire application a "derived ... this is what the GPL clause seems to ...
    (comp.lang.java.databases)
  • Re: accessing mySQL database with Java
    ... You're loading the ODBC driver and attempting to connect to an ... ODBC-style database URL, yet your subject line says that you're trying ... because MySQL and ODBC ...
    (comp.lang.java.databases)