#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Problem connecting to mysql


    problem with connecting to mySQL
    Hi..i have a hosting space and database taken from net4india..when i try to connect to the database using the following codes i get a internal server error 500..i am not able to understand what exactly is the problem with the codes

    i have contacted the hosting company a number of times thy say its all fine check ur coading

    plz help!

    <HTML>
    <HEAD>
    <TITLE>Untitled Document</TITLE>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    </HEAD>

    <BODY BGCOLOR="#FFFFFF">

    <%
    Dim sConnection
    Dim oConnection
    Dim oRS

    sConnection = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=00.00.000.00; DATABASE=xxxxxx; UID=xxxxxx;PASSWORD=xxxx; OPTION=3"

    Set oConnection = Server.CreateObject("ADODB.Connection")

    oConnection.Open sConnection

    Set oRS = oConnection.Execute("SELECT * FROM Table")

    While Not oRS.EOF
    Response.Write oRS("Name")
    oRS.MoveNext
    Wend

    oRS.Close
    Set oRS = Nothing

    oConnection.Close
    Set oConnection = Nothing
    %>




    </BODY>
    </HTML>
  2. #2
  3. No Profile Picture
    Stumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,409
    Rep Power
    4538
    What is the exact error message? There are hundreds of problems that can end up with a 500 error.

    Make sure the mysql driver installed on the web server matches your connection string. Maybe the host has an updated mysql driver installed.
    ======
    Doug G
    ======
    It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0
    the browser showes 500 internal server error the contents cant b displayed ... how can i get the exact problem?
    i have also tried with 5.1 driver its the same error
  6. #4
  7. No Profile Picture
    Stumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,409
    Rep Power
    4538
    Originally Posted by zubair_sait
    the browser showes 500 internal server error the contents cant b displayed ... how can i get the exact problem?
    i have also tried with 5.1 driver its the same error
    If the server admins have configured IIS to not send errors to the client you may have to ask them. If you use IE make sure "show friendly http errors" setting is off.

    You have to use a connection string that matches the driver that's installed on the web server. Simply changing your connection string won't actually change the driver.
    ======
    Doug G
    ======
    It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi

IMN logo majestic logo threadwatch logo seochat tools logo