Results 1 to 9 of 9

Thread: [RESOLVED] ODBC COM exception

  1. #1

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    Resolved [RESOLVED] ODBC COM exception

    Here's my situation. I'm using PHP to talk to 2 different MS SQL databases. One of them is setup by IT, the other is my development server. I'm using ADO/ODBC to talk to both, but it only works on the IT server. Granted, I'm only using this in cases of large text fields, otherwise I use the built-in PHP MSSQL library.

    My question isn't necessarily about the code, because I know the code is fine. I just need to know how to setup the ODBC driver on the development server so that my code can talk to it:
    Code:
     $conn = new COM("ADODB.Connection") or die("Cannot start ADO"); 
    $conn->Open("Provider=SQLOLEDB; Data Source=edlsql.hag.bulldog.com;Initial Catalog=TestCellData; User ID=labuser; Password=helab");
    I've tried playing with the Data Sources (Administrative Tools -> Data Sources), but I'm apparently missing something.

    Anything would be helpful.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: ODBC COM exception

    I think you need to change "Data Source=edlsql.hag.bulldog.com" to either:

    "Data Source=localhost" (if it is on the local computer)
    or:
    "Data Source=dev_server_name"

  3. #3

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    Re: ODBC COM exception

    Well, the name of the PC is "edlsql", and I use the the full URL of the IT server to talk to the other one. And the webserver and database server run on seperate servers, so localhost won't work.

    EDIT: And I tried that and it doesn't work.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: ODBC COM exception

    Is edlsql.hag.bulldog.com actually a valid address for that server? (to test you could try to ping it). I think it needs to be set in Active Directory (no idea how!)

    You could also try using the IP address of the server instead of a name.

  5. #5

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    Re: ODBC COM exception

    Yes, edlsql.hag.bulldog.com is a valid address (internal only, not to the WWW). And this is just running on a Win2K computer, no Active Directory involved. And I just tried using the IP, but that doesn't change it either.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: ODBC COM exception

    I'm afraid I have no more ideas, all I can suggest is checking the Connection Strings link in my signature (which says that IP addresses should actually be used a bit differently).

  7. #7
    Fanatic Member
    Join Date
    Jan 2005
    Location
    In front of this pc.
    Posts
    580

    Re: ODBC COM exception

    Maybe I'm off base here but I'm thinking that by using the server name, as edlsql.hag.bulldog.com, is causing the app to attempt to connect via the internet rather than the intranet and that using the public IPA would have the same result.

    Perhaps the server also has an intranet IPA (something in the 10.10 range?) and you would have better luck using that. Other than that perhaps the LAN admin has blocked, either at the router or via a firewall, access to whatever port it is that MsSql runs on

  8. #8

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    Re: ODBC COM exception

    I'd appreciate any other ideas on this one. The address IS an intranet address, so it's not going to the net for it. As I said previously, this all works perfectly on the main IT server, but it does not work on my development server.

    Again, I'm thinking it has something to do with ODBC on the server itself, but I don't have the experience to diagnose it.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  9. #9

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    Re: ODBC COM exception

    Nevermind. I had to add the ODBC link on the webserver.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

Posting Permissions

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



Click Here to Expand Forum to Full Width