Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL 2005 Express - Connnection issue

Author  Topic 

jakobt
Starting Member

5 Posts

Posted - 2007-11-12 : 11:29:36
I´ve set up a local database on my hosted webserver, and successfully connect to it using Management Studio as well as sqlcmd. But when I try to connect to it through my web application I get problems. I´ve enabled TCP/IP and Named pipes for my SQL Express instance.

My Connstring: "Driver={SQL Native
Client};Server=.\SQLEXPRESS;Database=my_database;Uid=my_user;Pwd=my_password"

I get a "[Microsoft][SQL Native Client]TCP Provider: No such host is known." error, and I suspect that the firewall might be the problem, but don´t have access to that at the moment.

Any ideas?


Jakob, Sweden

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-11-12 : 22:12:25
Is it correct instance name? Tried with host_name\sqlexpress? Does web app run on that sql server?
Go to Top of Page

jakobt
Starting Member

5 Posts

Posted - 2007-11-13 : 01:52:26
Seems like this just turned into an ASP-question: =)

This VBScript works:

<%
set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Driver={SQL Native Client};Server=.\SQLEXPRESS;Database=my_database;Uid=my_user;Pwd=my_password;"

%>

But this JSCRIPT gets the above error:

<%@LANGUAGE=JSCRIPT%>
<%
var conn = Server.CreateObject("ADODB.Connection");
conn.Open("Driver={SQL Native Client};Server=.\SQLEXPRESS;Database=my_database;Uid=my_user;Pwd=my_password;");

%>


The exact same script works on my local web server (IIS 5.1).
Go to Top of Page

jakobt
Starting Member

5 Posts

Posted - 2007-11-13 : 07:34:06
Made a DSN-connection instead and it started working... don´t ask me why...
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-11-13 : 07:45:59
www.connectionstrings.com

"Provider=SQLNCLI;Server=.\SQLEXPRESS;Database=myDataBase;Uid=myUsername;Pwd=myPassword;"


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -