Results 1 to 2 of 2

Thread: javascript and mysql

  1. #1
    Join Date
    Jan 2003
    Posts
    1

    Cool javascript and mysql

    I am been programming ASP pages (server-side javascript) that connect to Access and MS SQL databases for some time. Now I have a client with an existing mysql database and they've asked me to develop a new site for them.

    My Question: Can I access mysql databases using server-side javascript? What will the connection statements look like (would it still be 'adoConnection = Server.CreateObject()')? The only info I've been able to find so far is about PHP and mysql.

    Thanks!

  2. #2
    Join Date
    Jan 2003
    Location
    Mid West, United States, State of Minnesota
    Posts
    3

    Question Would ODBC work?

    I have only breifly messed with ASP's once before, using MS Interdev a long time ago, but I think they allowed a connection via ODBC, and MYSQL does have a ODBC driver for it. I suggest you try downloading the ODBC driver for mysql, and trying to access it that way if you R using ASP's.

    Sorry if this is of no help, only thing I can think of that might work.

    Here is example using ADO to connect to an ODBC data soure, The DSN name is what you call the database ODBC connetion setup on the server with MySQL ODBC.

    dim conn as ADODB.Connection
    dim rs as recordset
    Conn.Open "MyODBC_DSN", "MyDBUserName", "MyDBPassword"
    Set RS = Conn.Execute( "SELECT * FROM theTable" )
    do while not rs.eof
    ___msgbox RS(i).Value<% Next %>
    ___rs.movenext
    loop


    Here is the URL, good luck

    http://www.mysql.com/downloads/api-myodbc.html
    Last edited by i6fpwonder; 01-29-2003 at 02:12 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •