SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard
    Join Date
    Apr 2004
    Location
    dublin
    Posts
    2,036
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MSSQL Connection

    Hi all,

    What does the below error mean?
    Here's my odbc connection.
    PHP Code:
    $db_link odbc_connect($dsn$username$password)
        or die(
    'Error connecting to server. Server says: '.htmlspecialchars(odbc_errormsg())); 

    Error connecting to server. Server says: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

  2. #2
    SitePoint Wizard
    Join Date
    Apr 2004
    Location
    dublin
    Posts
    2,036
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MSSQL Data Source

    Hi all,

    How do I setup my odbc datasource properly in MSSQL Server 2005?

    Using PHP to connect to MSSQL.

    Thanks.

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    i see by your other thread that you did manage to solve this

    would you mind please posting the solution, for the benefit of other people who might find this thread in a search
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  4. #4
    SitePoint Wizard
    Join Date
    Apr 2004
    Location
    dublin
    Posts
    2,036
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Certainly Rudy.

    I used php ms_connect functions rather than odbc...
    PHP Code:
     // Connect to database
     
    $db mssql_pconnect('localhost''training''training2');
     
     if (!
    $db)
     {
           echo 
    '<p>Could not connect to database</p>';
          exit;
     }
     
     
    // Select Database
     
    mssql_select_db('training_dub') or die('Error connecting to Database. Server says: '.htmlspecialchars(odbc_errormsg()));; 
    Then to setup the DNS I followed this article...
    http://technet2.microsoft.com/Window...f5d4d1033.mspx

    Hope this helps.

  5. #5
    SitePoint Guru
    Join Date
    Aug 2003
    Location
    CT
    Posts
    643
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    edit, i'm a moron
    Last edited by briansol; Feb 9, 2006 at 09:56.

  6. #6
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  7. #7
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,653
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    No, he meant DNS (to connect to the DB).

    For ODBC one needs to create a machine data source (START->SETTINGS->CONTROL PANEL->ADMINISTRATIVE TOOLS->DATA SOURCES) with the appropriate settings.


Bookmarks

Posting Permissions

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