SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL 2005 Express - Connnection issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jakobt
Starting Member

5 Posts

Posted - 11/12/2007 :  11:29:36  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
7266 Posts

Posted - 11/12/2007 :  22:12:25  Show Profile  Reply with Quote
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 - 11/13/2007 :  01:52:26  Show Profile  Reply with Quote
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).

Edited by - jakobt on 11/15/2007 05:20:24
Go to Top of Page

jakobt
Starting Member

5 Posts

Posted - 11/13/2007 :  07:34:06  Show Profile  Reply with Quote
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

Sweden
30218 Posts

Posted - 11/13/2007 :  07:45:59  Show Profile  Visit SwePeso's Homepage  Reply with Quote
www.connectionstrings.com

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


E 12°55'05.25"
N 56°04'39.16"

Edited by - SwePeso on 11/13/2007 07:47:11
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000