dbTalk Databases Forums  

server connection

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss server connection in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Fabiof
 
Posts: n/a

Default server connection - 08-25-2011 , 08:22 PM






I have an interesting issue connecting to ms sql server.

I'm connecting to the server with in a legacy asp application just
fine. The same application has some page in asp but written in
javascript. When I try to connect to the sql server I get the
following error.

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.

Here is the connection string. Any help would be appreciated.

connection_object = Server.CreateObject("ADODB.Connection");
connection_object.CursorLocation = 3;
connection_object.ConnectionString = "Provider=SQLOLEDB.
1;Password=xxx;Persist Security Info=True;User ID=xxx;Data Source=.
\SQLEXPRESS;initial catalog=xxxx;"

connection_object.Open();

Thanks.

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: server connection - 08-26-2011 , 02:29 AM






Fabiof (fabio.folino (AT) gmail (DOT) com) writes:
Quote:
I'm connecting to the server with in a legacy asp application just
fine. The same application has some page in asp but written in
javascript. When I try to connect to the sql server I get the
following error.

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.

Here is the connection string. Any help would be appreciated.

connection_object = Server.CreateObject("ADODB.Connection");
connection_object.CursorLocation = 3;
connection_object.ConnectionString = "Provider=SQLOLEDB.
1;Password=xxx;Persist Security Info=True;User ID=xxx;Data Source=.
\SQLEXPRESS;initial catalog=xxxx;"

connection_object.Open();
So this is the Javascript code? I don't know Javascript, but in some
languages \ is used as an escape character, why you need to double it
if you want to includee as-is. That is, try:

Data Source=.\\SQLEXRESS


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #3  
Old   
Bob Barrows
 
Posts: n/a

Default Re: server connection - 08-26-2011 , 07:10 AM



Fabiof wrote:
Quote:
I have an interesting issue connecting to ms sql server.

I'm connecting to the server with in a legacy asp application just
fine. The same application has some page in asp but written in
javascript. When I try to connect to the sql server I get the
following error.

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.

Here is the connection string. Any help would be appreciated.

connection_object = Server.CreateObject("ADODB.Connection");
connection_object.CursorLocation = 3;
connection_object.ConnectionString = "Provider=SQLOLEDB.
1;Password=xxx;Persist Security Info=True;User ID=xxx;Data Source=.
\SQLEXPRESS;initial catalog=xxxx;"

connection_object.Open();

I believe Erland is correct. You could have figured this out using the basic
ddebugging technique of assigning the string to a variable and using
response.write to view the content of the variable:

var cstr = "Provider=SQLOLEDB.
1;Password=xxx;Persist Security Info=True;User ID=xxx;Data Source=.
\SQLEXPRESS;initial catalog=xxxx;";
Response.Write(cstr);
connection_object.Open(cstr);

Doing so would have made you realize you have a javascript problem rather
than a sql server problem and allowed you to decide to post your question to
a javascript group instead.

Reply With Quote
  #4  
Old   
Mark D Powell
 
Posts: n/a

Default Re: server connection - 08-31-2011 , 03:03 PM



On Aug 26, 8:10*am, "Bob Barrows" <reb01... (AT) NOSPAMyahoo (DOT) com> wrote:
Quote:
Fabiof wrote:
I have an interesting issue connecting to ms sql server.

I'm connecting to the server with in a legacy asp application just
fine. The same application has some page in asp but written in
javascript. When I try to connect to the sql server I get the
following error.

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.

Here is the connection string. Any help would be appreciated.

connection_object = Server.CreateObject("ADODB.Connection");
connection_object.CursorLocation = 3;
connection_object.ConnectionString = "Provider=SQLOLEDB.
1;Password=xxx;Persist Security Info=True;User ID=xxx;Data Source=.
\SQLEXPRESS;initial catalog=xxxx;"

connection_object.Open();

I believe Erland is correct. You could have figured this out using the basic
ddebugging technique of assigning the string to a variable and using
response.write to view the content of the variable:

var cstr = "Provider=SQLOLEDB.
1;Password=xxx;Persist Security Info=True;User ID=xxx;Data Source=.
\SQLEXPRESS;initial catalog=xxxx;";
Response.Write(cstr);
connection_object.Open(cstr);

Doing so would have made you realize you have a javascript problem rather
than a sql server problem and allowed you to decide to post your questionto
a javascript group instead.- Hide quoted text -

- Show quoted text -
Could SQLEXPRESS be an instance name and if so would the server name
need to appear before it in the string?

HTH -- Mark D Powell --

Reply With Quote
  #5  
Old   
Henk van den Berg
 
Posts: n/a

Default Re: server connection - 09-01-2011 , 10:55 AM



Mark D Powell schreef op 31-08-2011 22:03:

Quote:
var cstr = "Provider=SQLOLEDB.
1;Password=xxx;Persist Security Info=True;User ID=xxx;Data Source=.
\SQLEXPRESS;initial catalog=xxxx;";
Response.Write(cstr);
connection_object.Open(cstr);

Doing so would have made you realize you have a javascript problem rather
than a sql server problem and allowed you to decide to post your question to
a javascript group instead.- Hide quoted text -

- Show quoted text -

Could SQLEXPRESS be an instance name and if so would the server name
need to appear before it in the string?
It is (instance name) and it does (server name).

"." is shorthand for local machine

Best,
Henk

Quote:
HTH -- Mark D Powell --

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.