Guys
I have a couple of lines of code:
VB Code:
if request.servervariables("HTTP_HOST") = "localhost" Then strConnex = "Provider=sqloledb;SERVER=MyLapTop;UID=MyUID;PWD=MyPWD;DATABASE=MyDB" else strConnex = "Provider=sqloledb;SERVER=mywebserver;UID=MyUID;PWD=MyPWD;DATABASE=MyDB" End if
which, on my laptop (MyLapTop) works just fine. I have another machine, however, sitting right next to me on the same network that can open and query the database on my laptop from Enterprise Manager/Query Analyser however when I try to use the bit of code above I get the error:
Microsoft OLE DB Provider for SQL Server (0x80004005) [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
This is when I try to open the connection using:
VB Code:
Set counterConn = Server.CreateObject("ADODB.Connection") counterConn.open strConnex
If, however, I comment out the test for localhost and go straight out the the webserver database then that connects ok.
Any ideas?!
Incidentally, I'm pretty sure that this worked before I went on holiday. I don't know, leave a network engineer in charge of things for 2 weeks and look what happens......!![]()




Reply With Quote