Dealing with Troubled Connections to SQL Express

We had a problem with an install today for a SQL application and SQL Express. The database was created properly and we set up Express to accept remote connections, but for some reason, none of the client machines would connect to it.



The error we were getting was ConnectionOpen (gethostbyname()).



It was frustrating to say the least - we tried switching between TCP/IP and Named Pipes and a variety of things - all to no avail - until I came across this post:



SQL Server Express WebLog : How to: Configure Express to accept remote connections



Finding this post was particularly troublesome - after about 15 minutes of solid searching, we finally found it referenced over on the SQL Education Center.



At any rate, we switched over to accessing the server directly by IP address and it worked perfectly.



Since it was easier to test by using a DSN with ODBC, even though we really use a connect string, we were able to pull back the Connect string easily with SQLGETPROP.



ln = sqlconnect("TestDNS")

IF ln <1

    MESSAGEBOX("Did not connect")

ENDIF

lc = SQLGETPROP(ln,"ConnectString")

STRTOFILE(lc,"connect.ini")



Finding the solution however should have been easier in my mind. The MS KB had nothing that really helped except "blame the XP SP2 firewall".



So I post the link here in an effort to make the search easier.









Powered by ScribeFire.

Comments

Popular Posts