First time using ASP to connect to remote MySQL database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nicky77
    New Member
    • Aug 2007
    • 25

    First time using ASP to connect to remote MySQL database

    Hi, I'm a PHP developer and i've been asked to do some development for a site which is on a web server which only supports ASP. I had planned to have a bash at writing an ASP program (first time) on this server which will interact with a MySQL database on another web server (my company's web space). Would this be possible?
  • JamieHowarth0
    Recognized Expert Contributor
    • May 2007
    • 537

    #2
    Hi Nicky,

    ASP is definitely interoperable with MySQL - check out my website at www.cmdev-associates.com, uses MySQL 5 Community Edition with ASP and AJAX!

    You need the ODBC connector from MySQL (version 3.51 is the latest, from http://dev.mysql.com/downloads/connector/odbc/3.51.html) and get it installed on the server where your ASP pages reside

    You then need the following code:

    [CODE=asp]
    Set objDbConn = Server.CreateOb ject("ADODB.Con nection")
    strConn = "Driver={My SQL 3.51 ODBC Driver};Server= yourmysqlserver address.com;Dat abase=yourDB;"
    objDbConn.Curso rLocation = adUseClient
    objDbConn.Open strConn
    [/CODE]

    Simple as that!

    All the best,

    medicineworker

    Comment

    • mylo1968
      New Member
      • Oct 2006
      • 8

      #3
      Here:

      http://www.devarticles .com/c/a/MySQL/Two-Lessons-in-ASP-and-MySQL/

      ... is something to be taken into account with ASP/Vbscript and MySQL concerning date data type differences,

      Regards,

      Matti


      Originally posted by nicky77
      Hi, I'm a PHP developer and i've been asked to do some development for a site which is on a web server which only supports ASP. I had planned to have a bash at writing an ASP program (first time) on this server which will interact with a MySQL database on another web server (my company's web space). Would this be possible?

      Comment

      Working...