Simple ASP DB problem.

Discussion in 'ASP General' started by Des, Jan 15, 2008.

  1. Des

    Des Guest

    Des, Jan 15, 2008
    #1
    1. Advertising

  2. Des wrote:
    > I am trying to connect to a MySQL database on a windows server using
    > ASP / ADODB
    >
    > I keep getting unable to display page
    >
    > http://www.desmond-otoole.co.uk/index.asp
    >

    Not without seeing the code used to connect, as well as the acutal error
    message ... do you have "friendly errors" shut off so you you can see
    the actual errors in your browser?
    http://www.aspfaq.com/show.asp?id=2109

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Jan 15, 2008
    #2
    1. Advertising

  3. Des

    Des Guest

    On 15 Jan, 15:27, "Bob Barrows [MVP]" <>
    wrote:
    > Des wrote:
    > > I am trying to connect to a MySQL database on a windows server using
    > > ASP / ADODB

    >
    > > I keep getting unable to display page

    >
    > >http://www.desmond-otoole.co.uk/index.asp

    >
    > Not without seeing the code used to connect, as well as the acutal error
    > message ... do you have "friendly errors" shut off so you you can see
    > the actual errors in your browser?http://www.aspfaq.com/show.asp?id=2109
    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.


    ------------------
    Hear is the entire code for the page. This is a MYSQL database

    <%@ Language=VBScript %>

    <%
    Set connection = Server.CreateObject("ADODB.Connection")
    Set rsResult = Server.CreateObject("ADODB.Recordset")

    sqlconn =
    "Driver={mySQL};Server=mysql12.streamline.net;Database=desmondot;Uid=desmondot;Pwd=s131679"
    connection.Open sqlconn

    sqlResults = "SELECT * FROM Members"

    rsResult.Open sqlResults, connection
    rsResult.MoveFirst
    sName = rsResult("f_name")

    echo sName
    %>
     
    Des, Jan 15, 2008
    #3
  4. Des wrote:
    > On 15 Jan, 15:27, "Bob Barrows [MVP]" <>
    > wrote:
    >> Des wrote:
    >>> I am trying to connect to a MySQL database on a windows server using
    >>> ASP / ADODB

    >>
    >>> I keep getting unable to display page

    >>
    >>> http://www.desmond-otoole.co.uk/index.asp

    >>
    >> Not without seeing the code used to connect, as well as the acutal
    >> error message ... do you have "friendly errors" shut off so you you
    >> can see the actual errors in your
    >> browser?http://www.aspfaq.com/show.asp?id=2109
    >>

    >
    > ------------------
    > Hear is the entire code for the page. This is a MYSQL database
    >
    > <%@ Language=VBScript %>
    >
    > <%
    > Set connection = Server.CreateObject("ADODB.Connection")
    > Set rsResult = Server.CreateObject("ADODB.Recordset")
    >
    > sqlconn =
    >

    "Driver={mySQL};Server=mysql12.streamline.net;Database=desmondot;Uid=des
    mondot;Pwd=s131679"
    > connection.Open sqlconn
    >

    This is all the code I really needed to see. I don't use MySQL so I'm
    not sure how the server is supposed to be referred to. Maybe you can try
    an example at www.connectionstrings.com

    Where is the error message you are getting? You could modify your code
    to have vbscript handle the error and display the actual error message,
    like this:

    on error resume next
    connection.Open sqlconn
    if err <> 0 then
    Response.Write err.message
    else
    'open the recordset and process it
    end if

    You are limiting our ability to help you by not telling us what error
    message you are getting.

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Jan 15, 2008
    #4
  5. Des

    Jeff Dillon Guest

    Echo? Should be:

    Response.Write sName

    If that doesn't work, remove all other code, and have one line:

    <%

    Response.Write "Hello World"

    %>

    and go from there

    Jeff
    "Des" <> wrote in message
    news:...
    > On 15 Jan, 15:27, "Bob Barrows [MVP]" <>
    > wrote:
    >> Des wrote:
    >> > I am trying to connect to a MySQL database on a windows server using
    >> > ASP / ADODB

    >>
    >> > I keep getting unable to display page

    >>
    >> >http://www.desmond-otoole.co.uk/index.asp

    >>
    >> Not without seeing the code used to connect, as well as the acutal error
    >> message ... do you have "friendly errors" shut off so you you can see
    >> the actual errors in your browser?http://www.aspfaq.com/show.asp?id=2109
    >>
    >> --
    >> Microsoft MVP -- ASP/ASP.NET
    >> Please reply to the newsgroup. The email account listed in my From
    >> header is my spam trap, so I don't check it very often. You will get a
    >> quicker response by posting to the newsgroup.

    >
    > ------------------
    > Hear is the entire code for the page. This is a MYSQL database
    >
    > <%@ Language=VBScript %>
    >
    > <%
    > Set connection = Server.CreateObject("ADODB.Connection")
    > Set rsResult = Server.CreateObject("ADODB.Recordset")
    >
    > sqlconn =
    > "Driver={mySQL};Server=mysql12.streamline.net;Database=desmondot;Uid=desmondot;Pwd=s131679"
    > connection.Open sqlconn
    >
    > sqlResults = "SELECT * FROM Members"
    >
    > rsResult.Open sqlResults, connection
    > rsResult.MoveFirst
    > sName = rsResult("f_name")
    >
    > echo sName
    > %>
     
    Jeff Dillon, Jan 15, 2008
    #5
  6. Des

    Des Guest

    On 15 Jan, 18:19, "Jeff Dillon" <> wrote:
    > Echo? Should be:
    >
    > Response.Write sName
    >
    > If that doesn't work, remove all other code, and have one line:
    >
    > <%
    >
    > Response.Write "Hello World"
    >
    > %>
    >
    > and go from there
    >
    > Jeff"Des" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > On 15 Jan, 15:27, "Bob Barrows [MVP]" <>
    > > wrote:
    > >> Des wrote:
    > >> > I am trying to connect to a MySQL database on a windows server using
    > >> > ASP / ADODB

    >
    > >> > I keep getting unable to display page

    >
    > >> >http://www.desmond-otoole.co.uk/index.asp

    >
    > >> Not without seeing the code used to connect, as well as the acutal error
    > >> message ... do you have "friendly errors" shut off so you you can see
    > >> the actual errors in your browser?http://www.aspfaq.com/show.asp?id=2109

    >
    > >> --
    > >> Microsoft MVP -- ASP/ASP.NET
    > >> Please reply to the newsgroup. The email account listed in my From
    > >> header is my spam trap, so I don't check it very often. You will get a
    > >> quicker response by posting to the newsgroup.

    >
    > > ------------------
    > > Hear is the entire code for the page. This is a MYSQL database

    >
    > > <%@ Language=VBScript %>

    >
    > > <%
    > > Set connection = Server.CreateObject("ADODB.Connection")
    > > Set rsResult = Server.CreateObject("ADODB.Recordset")

    >
    > > sqlconn =
    > > "Driver={mySQL};Server=mysql12.streamline.net;Database=desmondot;Uid=desmon­dot;Pwd=s131679"
    > > connection.Open sqlconn

    >
    > > sqlResults = "SELECT * FROM Members"

    >
    > > rsResult.Open  sqlResults, connection
    > > rsResult.MoveFirst
    > > sName = rsResult("f_name")

    >
    > > echo sName
    > > %>- Hide quoted text -

    >
    > - Show quoted text -


    -----------------
    Error is
    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC Driver Manager] Data source name not found and no
    default driver specified

    /index.asp, line 9


    Line 7: sqlconn =
    "Driver={mySQL};Server=mysql12.streamline.net;Database=desmondot;Uid=desmondot;Pwd=s131679"
    Line 8: conn.ConnectionString = sqlconn
    Line 9: conn.open

    Desmond
     
    Des, Jan 15, 2008
    #6
  7. Des wrote:
    > Error is
    > Microsoft OLE DB Provider for ODBC Drivers error '80004005'
    >
    > [Microsoft][ODBC Driver Manager] Data source name not found and no
    > default driver specified
    >
    > /index.asp, line 9
    >
    >
    > Line 7: sqlconn =
    >

    "Driver={mySQL};Server=mysql12.streamline.net;Database=desmondot;Uid=des
    mondot;Pwd=s131679"
    > Line 8: conn.ConnectionString = sqlconn
    > Line 9: conn.open
    >

    Ok, have you verified the syntax of your connection string a
    www.connectionstrings.com?
    The "mysql12.streamline.net" bit looks suspicious to me, but I'm used
    the MS SQL Server, so that could be the correct way to refer to it. You
    should verify with a mysql newsgroup.

    Assuming the name you are using is correct, is that database server
    accessible to the web server? And particularly, is it accessible to the
    user account being used to run your code? If your website allows
    anonymous access, then that user account is the IUSR_MachineName account
    (replace "MachineName" with the name of the machine running the web
    server ... )

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Jan 15, 2008
    #7
  8. Des

    Des Guest

    On 15 Jan, 18:26, Des <> wrote:
    > On 15 Jan, 18:19, "Jeff Dillon" <> wrote:
    >
    >
    >
    >
    >
    > > Echo? Should be:

    >
    > > Response.Write sName

    >
    > > If that doesn't work, remove all other code, and have one line:

    >
    > > <%

    >
    > > Response.Write "Hello World"

    >
    > > %>

    >
    > > and go from there

    >
    > > Jeff"Des" <> wrote in message

    >
    > >news:...

    >
    > > > On 15 Jan, 15:27, "Bob Barrows [MVP]" <>
    > > > wrote:
    > > >> Des wrote:
    > > >> > I am trying to connect to a MySQL database on a windows server using
    > > >> > ASP / ADODB

    >
    > > >> > I keep getting unable to display page

    >
    > > >> >http://www.desmond-otoole.co.uk/index.asp

    >
    > > >> Not without seeing the code used to connect, as well as the acutal error
    > > >> message ... do you have "friendly errors" shut off so you you can see
    > > >> the actual errors in your browser?http://www.aspfaq.com/show.asp?id=2109

    >
    > > >> --
    > > >> Microsoft MVP -- ASP/ASP.NET
    > > >> Please reply to the newsgroup. The email account listed in my From
    > > >> header is my spam trap, so I don't check it very often. You will get a
    > > >> quicker response by posting to the newsgroup.

    >
    > > > ------------------
    > > > Hear is the entire code for the page. This is a MYSQL database

    >
    > > > <%@ Language=VBScript %>

    >
    > > > <%
    > > > Set connection = Server.CreateObject("ADODB.Connection")
    > > > Set rsResult = Server.CreateObject("ADODB.Recordset")

    >
    > > > sqlconn =
    > > > "Driver={mySQL};Server=mysql12.streamline.net;Database=desmondot;Uid=desmon­­dot;Pwd=s131679"
    > > > connection.Open sqlconn

    >
    > > > sqlResults = "SELECT * FROM Members"

    >
    > > > rsResult.Open  sqlResults, connection
    > > > rsResult.MoveFirst
    > > > sName = rsResult("f_name")

    >
    > > > echo sName
    > > > %>- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > -----------------
    > Error is
    > Microsoft OLE DB Provider for ODBC Drivers error '80004005'
    >
    > [Microsoft][ODBC Driver Manager] Data source name not found and no
    > default driver specified
    >
    > /index.asp, line 9
    >
    > Line 7: sqlconn =
    > "Driver={mySQL};Server=mysql12.streamline.net;Database=desmondot;Uid=desmon­dot;Pwd=s131679"
    > Line 8: conn.ConnectionString = sqlconn
    > Line 9: conn.open
    >
    > Desmond- Hide quoted text -
    >
    > - Show quoted text -


    =================
    Thanks Guys. I have changed the connection string to
    "Driver={MySQL ODBC 3.51
    Driver};Server=mysql12.streamline.net;Database=desmondot;Uid=desmondot;Pwd=s131679"
    NOW this works

    Cheers -> Desmond
     
    Des, Jan 15, 2008
    #8
  9. Des

    Ted Dawson Guest

    NOW would be a very good time to change your password.
     
    Ted Dawson, Jan 15, 2008
    #9
  10. Des

    Evertjan. Guest

    Ted Dawson wrote on 15 jan 2008 in microsoft.public.inetserver.asp.general:

    > NOW would be a very good time to change your password.


    Now would be a better time to learn quoting, Ted.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Jan 15, 2008
    #10
  11. Des

    Ted Dawson Guest

    >> NOW would be a very good time to change your password.
    >
    > Now would be a better time to learn quoting, Ted.




    Didn't want to repeat the PW again.
     
    Ted Dawson, Jan 15, 2008
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    566
  2. Kevin Spencer

    Re: Simple Simple question!!!

    Kevin Spencer, Jun 25, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    673
    Kevin Spencer
    Jun 25, 2004
  3. Dave E
    Replies:
    7
    Views:
    752
    Josh Twist
    Jan 11, 2006
  4. Daniel Frey

    Simple Question - Simple Answer?

    Daniel Frey, Dec 28, 2004, in forum: XML
    Replies:
    4
    Views:
    846
    Daniel Frey
    Jan 12, 2005
  5. dillon
    Replies:
    1
    Views:
    181
    higabe
    Nov 17, 2003
Loading...

Share This Page