# Database Discussions > MySQL >  javascript and mysql

## seveninstl

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!

----------


## i6fpwonder

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

----------

