Professional Web Applications Themes

mySQL Connection String - ASP Database

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 [url]http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm#ODBCDriverForSybaseSQLAnywhere[/url]....

  1. #1

    Default mySQL Connection String

    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
    [url]http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm#ODBCDriverForSybaseSQLAnywhere[/url].




    IPT Guest

  2. #2

    Default Re: mySQL Connection String


    "IPT" <chencystreamyx.com> wrote in message
    news:efxTr%236VEHA.2972TK2MSFTNGP11.phx.gbl...
    > 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")
    the connection string I use [somewhat flakey!] but you might have some luck
    with it is:

    <%
    strConnection = "driver={MySQL};server=localhost;uid=username; "
    strConnection = strConnection & "pwd=password;database=databasename"
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.Open strConnection
    %>
    hope that helps

    Wayne...


    Wayne... Guest

  3. #3

    Default Re: mySQL Connection String

    On Tue, 22 Jun 2004 00:49:03 +0800, "IPT" <chencystreamyx.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
    >[url]http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm#ODBCDriverForSybaseSQLAnywhere[/url].
    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:

    [url]http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForMySQL[/url]

    Data Source, User ID and Password will need to be edited for your
    specifc setup.

    Jeff
    Jeff Cochran Guest

  4. #4

    Default Re: mySQL Connection String

    On Tue, 22 Jun 2004 14:24:21 GMT, [email]jeff.nospamzina.com[/email] (Jeff Cochran) wrote:
    >On Tue, 22 Jun 2004 00:49:03 +0800, "IPT" <chencystreamyx.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
    >>[url]http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm#ODBCDriverForSybaseSQLAnywhere[/url].
    >
    >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:
    >
    >[url]http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForMySQL[/url]
    >
    >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..


    Turkbear Guest

  5. #5

    Default Re: mySQL Connection String

    Oh my God!

    I typed wrongly. This could be due to the scenario where I tried both
    databasees.

    My actual words should go like this:

    "I use Sybase SQL Anywhere 5.0 with engine 5.5.04 Build #1867 but can't
    connect."

    Sorry.

    "Turkbear" <noonenowhere.com> wrote in message
    news:l1ogd01r6sscjj3kgubibm7j7n11ap0p174ax.com...
    > On Tue, 22 Jun 2004 14:24:21 GMT, [email]jeff.nospamzina.com[/email] (Jeff Cochran)
    wrote:
    >
    > >On Tue, 22 Jun 2004 00:49:03 +0800, "IPT" <chencystreamyx.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
    >
    >>[url]http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm#ODBCDr[/url]
    iverForSybaseSQLAnywhere.
    > >
    > >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:
    > >
    >
    >[url]http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLED[/url]
    BProviderForMySQL
    > >
    > >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..
    >
    >

    IPT Guest

  6. #6

    Default Re: mySQL Connection String

    On Thu, 24 Jun 2004 12:21:01 +0800, "IPT" <iwanswopt.com> wrote:
    >Oh my God!
    >
    >I typed wrongly. This could be due to the scenario where I tried both
    >databasees.
    >
    >My actual words should go like this:
    >
    >"I use Sybase SQL Anywhere 5.0 with engine 5.5.04 Build #1867 but can't
    >connect."
    Then your next step is to check here:

    Why do I get database-related 80004005 errors?
    [url]http://www.aspfaq.com/show.asp?id=2009[/url]

    Jeff
    >
    >Sorry.
    >
    >"Turkbear" <noonenowhere.com> wrote in message
    >news:l1ogd01r6sscjj3kgubibm7j7n11ap0p174ax.com.. .
    >> On Tue, 22 Jun 2004 14:24:21 GMT, [email]jeff.nospamzina.com[/email] (Jeff Cochran)
    >wrote:
    >>
    >> >On Tue, 22 Jun 2004 00:49:03 +0800, "IPT" <chencystreamyx.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
    >>
    >>>[url]http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm#ODBCDr[/url]
    >iverForSybaseSQLAnywhere.
    >> >
    >> >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:
    >> >
    >>
    >>[url]http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLED[/url]
    >BProviderForMySQL
    >> >
    >> >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..
    >>
    >>
    >
    Jeff Cochran Guest

Similar Threads

  1. Replies: 1
    Last Post: January 23rd, 12:06 PM
  2. need help with connection string
    By doof moof in forum Macromedia Flash Flashcom
    Replies: 5
    Last Post: October 18th, 03:08 PM
  3. connection string
    By Dionísio Monteiro in forum ASP Database
    Replies: 6
    Last Post: April 20th, 01:24 PM
  4. 'Connection String not work'..
    By Vincent Jones in forum ASP Database
    Replies: 1
    Last Post: January 24th, 09:59 PM
  5. DB Connection String
    By A.M in forum ASP.NET Security
    Replies: 4
    Last Post: January 20th, 05:14 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139