Accessing MySQL database

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

  1. #1

    Default Accessing MySQL database

    I assume you have downloaded the MYSQL ODBC Driver?

    Once you have done that and installed it, it should work
    the same as any ODBC driver. You might want to look at
    [url]www.connectionstrings.com[/url]. They have hundreds of
    connection strings listed and MySQL may be there.




    >-----Original Message-----
    >Can anyone point me to a resource for accessing MySQL
    databases from
    >ASP?
    >
    >Thanks!
    >
    >--Dave
    >.
    >
    John Beschler Guest

  2. Similar Questions and Discussions

    1. MySQL Database not retrieving the full database
      Hi, I am using MySQL and PHP for my repository. It has 500+ records. till now it was displayiing all records in the database, but since from one...
    2. Accessing database
      I've succesfully built cfm webpage from the getting started tutorial of CF MX7. Refering to the tutorial i wonder if i can let a user to edit the...
    3. accessing database from webservice
      I'm trying to let my webs ervice access a database, from non public site. It works on my local maschin and on a test server i setup. but i doesn't...
    4. Accessing a database from two cities
      I just found this group so I don't know if this has been discussed previously. Is there a simple way for my partner and me to use the same...
    5. accessing database question
      Is there a downside to using multiple tables in an Access database file that is having information written to the different tables and accessed at...
  3. #2

    Default Re: Accessing MySQL database

    Thanks. MySQL is listed, but their sample didn't work:

    Driver={mySQL};Server=localhost;Option=16834;Datab ase=webdata;

    I get the error:

    [Microsoft][ODBC Driver Manager] Data source name not found and no
    default driver specified

    I also tried changing the server name to the name of my server instead
    of localhost, but I get the same error.

    --Dave

    In article <033a01c35789$82807aa0$a101280a@phx.gbl>, [email]giles@geewhiz.com[/email]
    says...
    > I assume you have downloaded the MYSQL ODBC Driver?
    >
    > Once you have done that and installed it, it should work
    > the same as any ODBC driver. You might want to look at
    > [url]www.connectionstrings.com[/url]. They have hundreds of
    > connection strings listed and MySQL may be there.
    >
    >
    >
    >
    >
    > >-----Original Message-----
    > >Can anyone point me to a resource for accessing MySQL
    > databases from
    > >ASP?
    > >
    > >Thanks!
    > >
    > >--Dave
    > >.
    > >
    >
    Dave Navarro Guest

  4. #3

    Default Re: Accessing MySQL database

    Please post relevant code and let us take a look at it.


    >-----Original Message-----
    >Thanks. MySQL is listed, but their sample didn't work:
    >
    >Driver=
    {mySQL};Server=localhost;Option=16834;Database=web data;
    >
    >I get the error:
    >
    >[Microsoft][ODBC Driver Manager] Data source name not
    found and no
    >default driver specified
    >
    >I also tried changing the server name to the name of my
    server instead
    >of localhost, but I get the same error.
    >
    >--Dave
    >
    >In article <033a01c35789$82807aa0$a101280a@phx.gbl>,
    [email]giles@geewhiz.com[/email]
    >says...
    >> I assume you have downloaded the MYSQL ODBC Driver?
    >>
    >> Once you have done that and installed it, it should
    work
    >> the same as any ODBC driver. You might want to look at
    >> [url]www.connectionstrings.com[/url]. They have hundreds of
    >> connection strings listed and MySQL may be there.
    >>
    >>
    >>
    >>
    >>
    >> >-----Original Message-----
    >> >Can anyone point me to a resource for accessing MySQL
    >> databases from
    >> >ASP?
    >> >
    >> >Thanks!
    >> >
    >> >--Dave
    >> >.
    >> >
    >>
    >.
    >
    John Beschler Guest

  5. #4

    Default Re: Accessing MySQL database

    <%@ Language=VBScript %>
    <%
    set conn = Server.CreateObject("ADODB.Connection")

    conn.Open "Driver={mySQL};Server=localhost;Option=
    16834;Database=webdata;uid=user;pwd=password"

    set rs = conn.execute("SELECT * FROM clients")

    response.write rs("clientname")

    conn.Close

    set conn = Nothing

    %>

    --Dave

    In article <037201c357a9$635c78c0$a501280a@phx.gbl>, [email]giles@geewhiz.com[/email]
    says...
    > Please post relevant code and let us take a look at it.
    >
    > >-----Original Message-----
    > >Thanks. MySQL is listed, but their sample didn't work:
    > >
    > >Driver=
    > {mySQL};Server=localhost;Option=16834;Database=web data;
    > >
    > >I get the error:
    > >
    > >[Microsoft][ODBC Driver Manager] Data source name not
    > found and no
    > >default driver specified
    > >
    > >I also tried changing the server name to the name of my
    > server instead
    > >of localhost, but I get the same error.
    > >
    > >In article <033a01c35789$82807aa0$a101280a@phx.gbl>,
    > [email]giles@geewhiz.com[/email]
    > >says...
    > >> I assume you have downloaded the MYSQL ODBC Driver?
    > >>
    > >> Once you have done that and installed it, it should
    > work
    > >> the same as any ODBC driver. You might want to look at
    > >> [url]www.connectionstrings.com[/url]. They have hundreds of
    > >> connection strings listed and MySQL may be there.
    > >>
    > >> >-----Original Message-----
    > >> >Can anyone point me to a resource for accessing MySQL
    > >> databases from
    > >> >ASP?
    > >> >
    > >> >Thanks!
    Dave Navarro Guest

  6. #5

    Default Re: Accessing MySQL database

    Well, I'm at the limits of my experience. We had MySQL
    installed for evaluation purposes a while back and I did
    some testing. When I was done, we pulled it back off and I
    don't have any of my examples left. You might check
    [url]www.mysql.com[/url] for more help.

    Sorry :(
    John


    >-----Original Message-----
    ><%@ Language=VBScript %>
    ><%
    >set conn = Server.CreateObject("ADODB.Connection")
    >
    >conn.Open "Driver={mySQL};Server=localhost;Option=
    >16834;Database=webdata;uid=user;pwd=password"
    >
    >set rs = conn.execute("SELECT * FROM clients")
    >
    >response.write rs("clientname")
    >
    >conn.Close
    >
    >set conn = Nothing
    >
    >%>
    >
    >--Dave
    >
    >In article <037201c357a9$635c78c0$a501280a@phx.gbl>,
    [email]giles@geewhiz.com[/email]
    >says...
    >> Please post relevant code and let us take a look at it.
    >>
    >> >-----Original Message-----
    >> >Thanks. MySQL is listed, but their sample didn't work:
    >> >
    >> >Driver=
    >> {mySQL};Server=localhost;Option=16834;Database=web data;
    >> >
    >> >I get the error:
    >> >
    >> >[Microsoft][ODBC Driver Manager] Data source name not
    >> found and no
    >> >default driver specified
    >> >
    >> >I also tried changing the server name to the name of
    my
    >> server instead
    >> >of localhost, but I get the same error.
    >> >
    >> >In article <033a01c35789$82807aa0$a101280a@phx.gbl>,
    >> [email]giles@geewhiz.com[/email]
    >> >says...
    >> >> I assume you have downloaded the MYSQL ODBC Driver?
    >> >>
    >> >> Once you have done that and installed it, it should
    >> work
    >> >> the same as any ODBC driver. You might want to look
    at
    >> >> [url]www.connectionstrings.com[/url]. They have hundreds of
    >> >> connection strings listed and MySQL may be there.
    >> >>
    >> >> >-----Original Message-----
    >> >> >Can anyone point me to a resource for accessing
    MySQL
    >> >> databases from
    >> >> >ASP?
    >> >> >
    >> >> >Thanks!
    >.
    >
    John Beschler Guest

  7. #6

    Default Re: Accessing MySQL database

    John,

    I find it much simpler to create a odbc dsn to the mysql db and access it
    with asp as follows:

    ******************************
    Set connect = Server.CreateObject("ADODB.Connection")
    Set objFS = Server.CreateObject("Scripting.FileSystemObject")
    connect.Open "<odbc dsn name>", "<mysql db user>", "<mysql db password>"
    ******************************

    Query against the database as follows:

    ******************************
    strQ = "<mysql query>"
    Set r1 = connect.Execute(strQ)
    <variable name> = r1.fields(<field number>)
    ******************************

    Then use the following code to close the connection when you're finished:

    ******************************
    connect.Close
    Set objFS = Nothing
    Set connect = Nothing
    ******************************


    Joel Guest

  8. #7

    Default Re: Accessing MySQL database

    Thanks!

    --Dave

    In article <3_tWa.7648$Ly2.1226200@cletus.bright.net>,
    [email]joelseph@watchtv.net[/email] says...
    > John,
    >
    > I find it much simpler to create a odbc dsn to the mysql db and access it
    > with asp as follows:
    >
    > ******************************
    > Set connect = Server.CreateObject("ADODB.Connection")
    > Set objFS = Server.CreateObject("Scripting.FileSystemObject")
    > connect.Open "<odbc dsn name>", "<mysql db user>", "<mysql db password>"
    > ******************************
    >
    > Query against the database as follows:
    >
    > ******************************
    > strQ = "<mysql query>"
    > Set r1 = connect.Execute(strQ)
    > <variable name> = r1.fields(<field number>)
    > ******************************
    >
    > Then use the following code to close the connection when you're finished:
    >
    > ******************************
    > connect.Close
    > Set objFS = Nothing
    > Set connect = Nothing
    > ******************************
    Dave Navarro Guest

  9. #8

    Default Re: Accessing MySQL database

    Dave,

    If you are still having problems let me know. I installed
    MySQL and the OLEDB and ODBC drivers this AM and was able
    to connect to it useing OLEDB from a VB Script.

    John


    >-----Original Message-----
    >Thanks!
    >
    >--Dave
    >
    >In article <3_tWa.7648$Ly2.1226200@cletus.bright.net>,
    >joelseph@watchtv.net says...
    >> John,
    >>
    >> I find it much simpler to create a odbc dsn to the
    mysql db and access it
    >> with asp as follows:
    >>
    >> ******************************
    >> Set connect = Server.CreateObject("ADODB.Connection")
    >> Set objFS = Server.CreateObject
    ("Scripting.FileSystemObject")
    >> connect.Open "<odbc dsn name>", "<mysql db
    user>", "<mysql db password>"
    >> ******************************
    >>
    >> Query against the database as follows:
    >>
    >> ******************************
    >> strQ = "<mysql query>"
    >> Set r1 = connect.Execute(strQ)
    >> <variable name> = r1.fields(<field number>)
    >> ******************************
    >>
    >> Then use the following code to close the connection
    when you're finished:
    >>
    >> ******************************
    >> connect.Close
    >> Set objFS = Nothing
    >> Set connect = Nothing
    >> ******************************
    >.
    >
    John Beschler Guest

  10. #9

    Default Re: Accessing MySQL database

    In article <697701c35841$47120e30$a001280a@phx.gbl>, [email]giles@geewhiz.com[/email]
    says...
    > If you are still having problems let me know. I installed
    > MySQL and the OLEDB and ODBC drivers this AM and was able
    > to connect to it useing OLEDB from a VB Script.
    I was able to find and install MyODBC drivers, but I couldn't find the
    OLEDB drivers.

    I tried following the instructions at:

    [url]http://www.coveryourasp.com/Snippet.asp?snip=16[/url]

    But I couldn't find the "MySQLProv.2.5" file mentioned.

    I have MySQL properly installed (it's being used by a couple of sample
    PhP scripts). But I just can't connect to it from ASP.

    --Dave
    Dave Navarro Guest

  11. #10

    Default Re: Accessing MySQL database



    go here: [url]http://www.mysql.com/downloads/os-win32.html[/url]

    There at least 5 different OLEDB drivers available for
    download. I used MyOLEDB3.EXE




    >-----Original Message-----
    >In article <697701c35841$47120e30$a001280a@phx.gbl>,
    [email]giles@geewhiz.com[/email]
    >says...
    >> If you are still having problems let me know. I
    installed
    >> MySQL and the OLEDB and ODBC drivers this AM and was
    able
    >> to connect to it useing OLEDB from a VB Script.
    >
    >I was able to find and install MyODBC drivers, but I
    couldn't find the
    >OLEDB drivers.
    >
    >I tried following the instructions at:
    >
    >[url]http://www.coveryourasp.com/Snippet.asp?snip=16[/url]
    >
    >But I couldn't find the "MySQLProv.2.5" file mentioned.
    >
    >I have MySQL properly installed (it's being used by a
    couple of sample
    >PhP scripts). But I just can't connect to it from ASP.
    >
    >--Dave
    >.
    >
    John Beschler 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