Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Dec 2003
    Location
    texas
    Posts
    96
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question an odbc_connect error

    My code is below
    <?
    //connect to a DSN "Admin" with a user "" and password ""
    $connect = odbc_connect ("admin", "", "") or die("I cannot connect");

    //query the test table
    $query = "select * from studentinfo";

    //perform the query
    $result=odbc_exec($connect, $query);

    //fetch the data from the database
    while (odbc_fetch_row($result))
    {
    $name=odbc_result($result, 1);
    print ("StudentID");
    }
    //close the odbc drive
    odbc_close($connect);

    ?>

    I have an error and can not figure out what the problem is, and was wondering if someone might be able to help

    odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in <b>c:\inetpub\wwwroot\murf systems\TMP2aycovcgyd.php</b> on line <b>3</b><br />
    I cannot connect

    I have the odbc set up but do not have a password...with it I am tryin' to run the web site on my computer also if that matters?

    Thanks for the help in advance
    thanks
    bri

  • #2
    New to the CF scene
    Join Date
    May 2004
    Location
    England
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    Go into control panel

    ODBC Sources and setup a Entry in the 'System DSN' this should give you
    access to the database .

    Well at least for reading. If you successful in writing data back to the database please update my problem

  • #3
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Came across this thread, may be of help:
    http://bugs.php.net/bug.php?id=16812

    Sadiq.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •