开发者

"SQL Server does not exist or access denied." upon VB.Net Deployment

开发者 https://www.devze.com 2022-12-28 23:19 出处:网络
Have built a small VB.Net app in VS2010. The connection string to the SQL Server is as follows: <connectionStrings>

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 sea开发者_Python百科rch 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


OK, here we go:

  • Make sure you have network enabled on SQL Server - it is not enabled by default after install.
  • Do not forget your firewall ;) You may need to put up a firewall exception - this is ALSO not done by SQL Server setup automatically.
  • Sure you are not playing with IpSec? ;) Just asking - can make network connections disappear.

This is NOT an authentication error - it is a "server not reached" error. Access Denied on SQL level has a different error. THis is "server connection can not be established".

On top:

    connectionString="Provider=SQLOLEDB.1;Data

Source=SQLServer;Integrated Security=SSPI;Initial Catalog=IWSROL" providerName="System.Data.OleDb" />

BAD idea. Why the heck do you use the OleDb interface here instead of the SQL Server native client? You really like wasting resources, or is there a real reason?


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.


  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?


  • 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消