• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 510
  • Last Modified:

Connection String does not work !

Hello

I have build up an SQL Server 2008 R2 on Windows Server 2008 R2.

However, there is a connection problem with an x86 (32-bit) application which works fine under Windows XP Professional, but does not neither under Windows 7 nor Windows Server.

The connection string is as followed:

   Dim bConn As New ADODB.Connection
   Dim s As String
   s = "Provider=SQLNCLI10;Server=" & ip & ",1433;Database = xxx;Uid=yyy; Pwd=zzz;   Trusted_Connection=no;"
   bConn.Open (s)

Open in new window


This snippet works (!) fine under x86 Windows XP Professional.

Only Windows 7 64 Bit AND Windows Server 64 Bit report an error:

"Database connection could not be established:
Named Pipes-Provider: Could not connect to SQL Server [53]"

Named Pipes is deactivated on the Server. And I don't want Named Pipes.
TCP-Port is 1433 AND OPEN !!!

Even the Firewall on the server is down and deactivated.

Please help !

Thank you,

Stephan
0
StephanNL
Asked:
StephanNL
  • 9
  • 5
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you can try to force the protocol:
http://www.connectionstrings.com/articles/show/define-sql-server-network-protocol
by adding  Network=dbmssocn; to the connection string.

this said: the protocol is normally a negotiation between the server and the client.
on the service you can define which protocols are enabled (and the priority),
so the client can "choose" (or force) which protocol to use
0
 
StephanNLAuthor Commented:
Unfortunately, I can not compile the application with this connection string.
Any other idea ?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>I can not compile ?
I wonder what you did ... because the connection string is just a string and cannot make the app cannot compile. what compile error do you get?

you may get a run-time error?

anyhow, this is what I meant:
   Dim bConn As New ADODB.Connection
   Dim s As String
   s = "Provider=SQLNCLI10;Server=" & ip & ",1433;Network=dbmssocn;Database = xxx;Uid=yyy; Pwd=zzz;   Trusted_Connection=no;"
   bConn.Open (s)

Open in new window

0
A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

 
StephanNLAuthor Commented:
It seems to work.
0
 
StephanNLAuthor Commented:
I changed the connectionstring to:

"Provider=sqloledb;Data Source=" & ip & ",1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=myUsername;Password=myPassword;"

Error Message:

The database server could not be found.
[DBNETLIB] ConnectionOpen

Any suggestion ?
0
 
wrmichaelCommented:
Can you successfully setup a ODBC DSN connection from the control panel?

if so, setup a FILE DSN and you can test the settings easier until you find the right combo.
0
 
StephanNLAuthor Commented:
Thank you, so much for your help, since here.
ODBC works.
The connectionstring in the app still does not work, though.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
hmmm, that message (The database server could not be found) does not seem to be MS SQL Server actually ...
or is that a "translation" from the actual error message?
0
 
StephanNLAuthor Commented:
Under Windows 7 Professional I obtain the error message that the user can not be logged in.
Interestingly, the same user can be logged in under XP Prof.

I need ONE common connectionstring for both Windows XP as well as Windows 7.

Any idea ?
0
 
StephanNLAuthor Commented:
@angelIII  As you may have noticed, the origin is German and has been translated. ;)
0
 
StephanNLAuthor Commented:
What would a complete connectionstring for sqloledb.1 look like in SQL Mixed Mode ?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
your connection string is actually ok, there must be some other component playing bad here.
either some firewall (on the client, on the server or somewhere in between)
some aliasing/natting/whatever making the ip address or name you specify is not valid the same way (hostfile?) ...
I don't know from here what it could be ...
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
maybe something "stupid" like a 32 vs 64 bit installation of the oledb provider / sql client .....
0
 
StephanNLAuthor Commented:
;)
0
 
StephanNLAuthor Commented:
email me for team viewer...if you are interested
0

Featured Post

Automating Your MSP Business

The road to profitability.
Delivering superior services is key to ensuring customer satisfaction and the consequent long-term relationships that enable MSPs to lock in predictable, recurring revenue. What's the best way to deliver superior service? One word: automation.

  • 9
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now