mySQL Connection String

Ask a Question related to ASP Database, Design and Development.

  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. Similar Questions and Discussions

    1. #40207 [NEW]: Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL ser
      From: arif at peshawaronline dot com Operating system: PHP version: 4.4.4 PHP Bug Type: Compile Warning Bug description: ...
    2. need help with connection string
      i keep reading that it is not secure to hard code the connection string to the server into my swf. so how can i get the string into my swf without...
    3. connection string
      Hi there, I have recently changed the connection string on a site that was working perfectly. I used an OLE DB connection with this code: var...
    4. DB Connection String
      Hi, I need to store the database connection string inside web.config file. What would be the best way to encrypt and decrypt it? Thanks, Ali
    5. Oracle DSN Less Connection String
      Greetings.... Okay so far Dreamweaver MX connection to Oracle has left an awful bitter taste in my mouth.... I am trying a DSN Less Oracle...
  3. #2

    Default Re: mySQL Connection String


    "IPT" <chency@streamyx.com> wrote in message
    news:efxTr%236VEHA.2972@TK2MSFTNGP11.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

  4. #3

    Default Re: mySQL Connection String

    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
    >[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

  5. #4

    Default Re: mySQL Connection String

    On Tue, 22 Jun 2004 14:24:21 GMT, [email]jeff.nospam@zina.com[/email] (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
    >>[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

  6. #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" <noone@nowhere.com> wrote in message
    news:l1ogd01r6sscjj3kgubibm7j7n11ap0p17@4ax.com...
    > On Tue, 22 Jun 2004 14:24:21 GMT, [email]jeff.nospam@zina.com[/email] (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
    >
    >>[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

  7. #6

    Default Re: mySQL Connection String

    On Thu, 24 Jun 2004 12:21:01 +0800, "IPT" <iwan@swopt.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" <noone@nowhere.com> wrote in message
    >news:l1ogd01r6sscjj3kgubibm7j7n11ap0p17@4ax.com.. .
    >> On Tue, 22 Jun 2004 14:24:21 GMT, [email]jeff.nospam@zina.com[/email] (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
    >>
    >>>[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

Posting Permissions

  • You may not post new threads
  • You may 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