View Single Post
  #3 (permalink)  
Old September 24th, 2003, 05:24 AM
jacob jacob is offline
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, I found it pretty quickly. It is something like this...

Code:
Dim SomeDB
Set SomeDB = Server.CreateObject ("ADODB.Connection")
SomeDB.Open ("DRIVER=mysql;SERVER=[servername];UID=[username];PWD=[password];DATABASE=[databasename]")

Dim recTmp
Set recTmp = Server.CreateObject ("ADODB.Recordset")
recTmp.Open "SELECT * FROM testtable", SomeDB

Do
    Response.Write(recTmp("testcolumn"))
    recTmp.MoveNext
Loop While Not recTmp.EOF

recTmp.Close
Set recTmp = Nothing

SomeDB.Close
Set SomeDB = Nothing
Be aware that you have to change the red parts in the above connection string with the right value, and naturally use you name for the table and column.

Actually the way I found out about this was in the book 'Professional ASP Data Access' (WROX) which has got a section on MySQL databases, and how to connect to these.

Hope this helps ;)

Jacob.
Reply With Quote