There's No Place Like Localhost

Recently I reported an issue that I experienced with Document! X 5 and the sample SQL Server database project.  I couldn't open the project because the SQL Server connection would time out.  The bad part is that apparently although using localhost for some other environments such as VS 2005 works just fine, others didn't care for accepting localhost for a server name.  I can resolve localhost just fine over IP and HTTP.

Now for the good part which is a curable situation for the Document!X product.  Changing the server name from ‘localhost’ to my true machine name works in every case where the connection had previously failed.  This is the quick workaround for anyone that has this problem, or at the very least an alternative method, and I hope posting my findings will benefit others.

I also believe I’ve discovered the true issue which ultimately is not unique to Document!X clearly.  While testing with Crystal Reports XI and XMLSpy, I noticed that whenever the data provider was specified as the Microsoft OLE DB Provider for SQL Server either by default or manually by me, then the connection would fail.  The connection attempts fail for Integrated Security and SQL Server credentials as long as the server name used is ‘localhost’ and that specific provider is used.  However, changing the provider to the SQL Native Client in the applications that offered that functionality solves the issue immediately and connections can then be made using ‘localhost’, the true machine name, or even a DNS name mapped to the local machine with either Integrated Security or SQL Server credentials. 

At this point I don’t think the issue has anything to do with a 64-bit installation of either the OS or SQL Server.  I can squarely point to an issue with the Microsoft OLE DB provider for SQL Server, particularly attempting to use ‘localhost’ for a server name.  However, the issue can affect software like Document!X simply because an end user has no method for choosing which provider to use for the connection in Document!X.  Document!X, as far as I can tell, is coded to specifically use the OLE DB provider for SQL Server at this point.  Hopefully, Document!X will include access to the common Data Link Properties dialog hook so an end user can take advantage of database vendor enhancements in their provider code.

1 comment

Please sign in to leave a comment.