« Previous Next »

Not Answered Thread: odbc connection not work in asp connection

Last post 10-26-2009 10:29 PM by qbernard. 10 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (11 items)

Sort Posts:

  • 10-22-2009, 9:57 AM

    • apg1985
    • Not Ranked
    • Joined on 09-12-2007, 12:32 PM
    • Posts 5

    odbc connection not work in asp connection

    hi Guys,

    I know this is a .net forum but you guys have great all round knowledge and the best answers.

    Ive got a classic asp page which im trying to connect to a mysql db with - Ive installed iis 6, setup an odbc connection to the database and tested the connection so it does work, but when i run the index.asp page in explorer nothing displays and no errors coming up even through ive turned all that stuff on in iis manager. below is the code, hope you guys can help me problem solve.

    O and there is no query because as it stands it doesnt even show the text in the body tag as you can see below in the explorer source code

    Source code of page in explorer
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
    <BODY></BODY></HTML>
  • 10-22-2009, 10:04 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,254
    • IIS MVPs

    Re: odbc connection not work in asp connection

    That's OK, we specifically have a classic ASP forum for these types of questions.

    Please share your index.asp code ...

  • 10-22-2009, 10:05 AM In reply to

    Re: odbc connection not work in asp connection

    Easier way to troubshoot this is to put some debugging code in your script, say response.write "set odbc connect', then execute query xyz.. then output. we need to know where it break, does it even reach the db etc.

     

    Cheers,
    Bernard Cheah
  • 10-22-2009, 10:07 AM In reply to

    • apg1985
    • Not Ranked
    • Joined on 09-12-2007, 12:32 PM
    • Posts 5

    Re: odbc connection not work in asp connection

    Thanks for such a quick response - asp code below - could it be something to do with permissions in iis

    <%
    Set my_conn = Server.CreateObject("ADODB.Connection")
    Set rs = Server.CreateObject("ADODB.Recordset")
    my_conn.Open "DSN=testdb"
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    ITS WORKING
    </body>
    </html>

    O and if i remove my_conn.open "DSN=testdb" it runs and shows the body content in explorer

  • 10-22-2009, 10:17 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 6:27 AM
    • Central NJ
    • Posts 6,254
    • IIS MVPs

    Re: odbc connection not work in asp connection

    Did you create a system dsn? 

    Actually it would be better to use a non-dsn connection, then we can see the specifics of your connection string.

    http://www.webcheatsheet.com/asp/mysql_connection_strings.php

  • 10-22-2009, 10:37 AM In reply to

    • apg1985
    • Not Ranked
    • Joined on 09-12-2007, 12:32 PM
    • Posts 5

    Re: odbc connection not work in asp connection

    yeah the top one worked so thank you, why is the odbc connection not working then?? any ideas

  • 10-22-2009, 10:43 AM In reply to

    Re: odbc connection not work in asp connection

    No error msgs or so? it is tough to know what went wrong without error msgs.

     

    Cheers,
    Bernard Cheah
  • 10-22-2009, 11:36 AM In reply to

    • apg1985
    • Not Ranked
    • Joined on 09-12-2007, 12:32 PM
    • Posts 5

    Re: odbc connection not work in asp connection

    im getting no errors at all, but when i try to use anything to do with ADODB.Connection it doesnt work and only displays a blank page with no errors to help.

    This is absolute rubbish, its prob vista's fault, soon as i get home im going to try xp and i bet it will work fine

  • 10-24-2009, 9:38 AM In reply to

    Re: odbc connection not work in asp connection

    MM... maybe you can try enable details error msgs for asp. http://blogs.msdn.com/rakkimk/archive/2007/05/25/iis7-how-to-enable-the-detailed-error-messages-for-the-website-while-browsed-from-for-the-client-browsers.aspx
    Cheers,
    Bernard Cheah
  • 10-26-2009, 4:44 AM In reply to

    • apg1985
    • Not Ranked
    • Joined on 09-12-2007, 12:32 PM
    • Posts 5

    Re: odbc connection not work in asp connection

    the problem was in the odbc connection, in the tutorial i followed they never said which DSN to use so ive been using User DSN instead of System DSN.

    Sorry for waiting your time.

  • 10-26-2009, 10:29 PM In reply to

    Re: odbc connection not work in asp connection

    Ohh.. so the odbc connection is pointing somewhere else? .....
    Cheers,
    Bernard Cheah
Page 1 of 1 (11 items)
Microsoft Communities