views:

270

answers:

5

Have built a small VB.Net app in VS2010.

The connection string to the SQL Server is as follows:

    <connectionStrings>
    <add name="IWSR_DataDownloadWizard.My.MySettings.sqlConnection"
        connectionString="Provider=SQLOLEDB.1;Data Source=SQLServer;Integrated Security=SSPI;Initial Catalog=IWSROL"
        providerName="System.Data.OleDb" />
</connectionStrings>

Within the VS2010 environment AND on my machine, the connection works perfectly, however when I deploy to clients I get an error message of:

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

I've tried to search the net for solutions, have seen a few instances of people saying to NOT use the Server Name but the IP Address instead (this doesn't work) and some saying to remove the "Provider=SQLOLEDB.1", again this doesn't work.

Can anyone suggest a solution please?

Further information:

Development System is Windows7 using VS2010 Deployment systems are a combination of Windows XP, Windows 2000 and Windows 7 SQL Server is SQL2000 (soon to be SQL2005).

TIA

A: 
  1. Does the SQL server exist (can you ping it from the client)?

  2. Do they have access (you're using windows auth, so it will be their domain account)?

  3. Are you sure you want to use windows auth rather than SQL authentication?

Paddy
1) Yep, can ping the Server name and the IP Address no probs from my machines and clients.2) Again, all machines have access to the SQL Server via their domain account.3) Don't 'have' to use Windows Auth so it is an option to go SQL Auth.
JasonMHirst
@JasonMHirst - Then I'd go with the above and check your firewall/SQL server network setup.
Paddy
+1  A: 

It might be a network library mismatch. Your client is probably trying to access the SQL Server using TCP/IP but the server may only have named pipes enabled (or vice versa). There is a "Server Network Utility" on the server and equivalent on the client where you can configure the netwok libraries - make sure they are both set up in the same way and that the priority order has TCP/IP as the top priority.

Daniel Renshaw
A: 
  • Have you enabled the TCP/IP and/or named pipes protocol?
  • Can your clients access the "SQLSERVER" host name (i.e. can they ping it)?
  • Do they have access permissions on the SQL Server?
Magnus Johansson
+1  A: 
TomTom
Well I can't use the SQL Server within VS2010 because the only SQL Client is for 2005 and/or Azure. As originally pointed out in my post, we're using SQL2000 of which the only method to connect is via the OLEDb method.
JasonMHirst
This is... wrong to my knowledge. Did you try using the native client?
TomTom
Yep, get an error saying it can only be used on a machine running SQL2005.
JasonMHirst
Ouch. Good reason then. Consider upgrading - 2000 is REALLY not THAT good by todays standards ;)
TomTom
You absolutely can connect to SQL Server 2000 with System.Data.Sql.
HardCode
A: 

Thank you everyone who replied and offered support/assistance. VERY much appreciated.

Have resolved the problem, the Port was different and so the Connection String now reads:

<connectionStrings> 
<add name="IWSR_DataDownloadWizard.My.MySettings.sqlConnection" 
    connectionString="Provider=SQLOLEDB.1;Data Source=SQLServer,2433;Integrated Security=SSPI;Initial Catalog=IWSROL" 
    providerName="System.Data.OleDb" /> 

(not the new port number after the DataSource name).

Just WHY it works on my machine and not in deployment though I really have no idea.

JasonMHirst