Link to home
Start Free TrialLog in
Avatar of Bruce Gust
Bruce GustFlag for United States of America

asked on

Why doesn't my connection work?

I've got a SQL Server Studio installed with a quality connection to the database.

I've got an ODBC connection running happily that connects to the database named symbion_bgust.

The code on my page is:

<?php

$cxn=odbc_connect('symbion_bgust');
if(!$cxn)
{
echo "you're still not connected.";
}

Current landscape: My ODBC Connection was a bear getting to work. It wasn't until I used a Named Pipes configuration and made my database the default database. Only then was I able to get past all of the "tests" successfully.

When I go out to IIS Manager and click on "Database Manager" and double click on "Local SQL Server" I get an error that reads:

"An attempt to attach an auto-named database for file C:\Windows\system32\inetsrv\aspnetdb.mdf filed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."

Don't know if that's a factor, but the convoluted mess that I've had to contend with coupled with my ignorance has made for a very frustrating several hours.

Why am I not able to use a seemingly healthy ODBC connection and connect to my SQL Server?
Avatar of lcohan
lcohan
Flag of Canada image

"Why am I not able to use a seemingly healthy ODBC connection and connect to my SQL Server? "


Did you created a ODBC data source on that server with all the details? like server name/IP, database name, login, password? You need that to be created and tested to make sure you can connect to that server/database before using it in the code.
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bruce Gust

ASKER

Perfect!

Thanks, Dave!
You're welcome.