|
-
Sep 2nd, 2005, 03:14 PM
#1
Thread Starter
Frenzied Member
[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.
-
Sep 2nd, 2005, 03:36 PM
#2
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"
-
Sep 2nd, 2005, 03:58 PM
#3
Thread Starter
Frenzied Member
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.
-
Sep 2nd, 2005, 04:01 PM
#4
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.
-
Sep 2nd, 2005, 04:07 PM
#5
Thread Starter
Frenzied Member
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.
-
Sep 2nd, 2005, 05:03 PM
#6
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).
-
Sep 2nd, 2005, 06:06 PM
#7
Fanatic Member
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
-
Sep 6th, 2005, 08:20 AM
#8
Thread Starter
Frenzied Member
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.
-
Sep 6th, 2005, 09:00 AM
#9
Thread Starter
Frenzied Member
Re: ODBC COM exception
Nevermind. I had to add the ODBC link on the webserver.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|