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

sql server does not exist or access denied

hi experts,
i've been developing with vstudio.net for 2 weeks.
now i've built an cool application, so i can manage my records.
it works very nice on the developing host, it's a pc (win xp, sp1) where a sql server runs and where visual studio.net is installed and a odbc datasource is set.
everything works fine.
okay, now i installed the .net framework 1.1 on another pc and set up a odbc datasource, tested it, it works. then i started my application, and when i try to use it (e.g. i press a button that should show me the content of a table), it shows me an error message:

-error message start-
an unhandled exception has occured in your application. if you click continue, the application will ignore this error and attempt to continue. if you click quit, the application will be shut down immediately.

sql server does not exist or access is denied.
-error message end-

when i click "details" on this error message, following is shown:

-details start-
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
   at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
   at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
   at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
   at vinylmanager.Form4.Form4_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
System
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.DirectoryServices
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.directoryservices/1.0.5000.0__b03f5f7f11d50a3a/system.directoryservices.dll
----------------------------------------
System.Messaging
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.messaging/1.0.5000.0__b03f5f7f11d50a3a/system.messaging.dll
----------------------------------------
System.ServiceProcess
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.serviceprocess/1.0.5000.0__b03f5f7f11d50a3a/system.serviceprocess.dll
----------------------------------------
System.Data
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
----------------------------------------
vinylmanager
    Assembly Version: 1.0.1776.32847
    Win32 Version: 1.0.1776.32847
    CodeBase: file:///C:/Dokumente%20und%20Einstellungen/Administrator/Desktop/vinylmanager.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System.Xml
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
System.EnterpriseServices
    Assembly Version: 1.0.5000.0
    Win32 Version: 1.1.4322.573
    CodeBase: file:///c:/windows/assembly/gac/system.enterpriseservices/1.0.5000.0__b03f5f7f11d50a3a/system.enterpriseservices.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
-details end-

i've googled for a while and used the search function here at ee, but i couldn't find the solution.

i believe it's a problem of rights that should be set up on sql server.
can someone help me?

besides, sorry for my bad english :)

best regards from vienna.
0
xpuser01
Asked:
xpuser01
  • 4
  • 4
  • 4
  • +1
1 Solution
 
HeitmanProgrammersCommented:
what is the operating system on the Destination PC, because if it is not XP then you will need to install the MDAC and Jet from Microsoft's website.
0
 
xpuser01Author Commented:
hi,
both are xp machines and both have sp1.
0
 
ihenryCommented:
How does your connection look like?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ihenryCommented:
Sorry, I meant database connection string.
0
 
Jeff CertainCommented:
1. Check your connection string to ensure that the VS .NET application is conencting to the correct server, using a valid user name and the correct password.
2. Test to see that you can use the user credentials to access the SQL server using ODBC from your machine.
3. Try pinging the SQL server machine to see if you have a valid network connection to it.
4. Check to see that you are using SQL authentication on the server, not Windows only. There may be problems by using a different user login on the second machine, or due to domain issues.

Hope this helps.

Jeff
0
 
xpuser01Author Commented:
hi ihenry,
i'm not sure, but i think you mean this:

workstation id=MYWORKSTATIONSNAME;packet size=4096;integrated security=SSPI;initial catalog=testdb;persist security info=False
0
 
xpuser01Author Commented:
hi chaosian,
step1:  please check my connectionstring i've posted right above. user+password are suppied in the odbc datasource, aren't they?
step2: it works
step3: it works
step4: how to check this?
0
 
Jeff CertainCommented:
1. You should be using a connection string that looks more like this:
initial catalog=<catalog>;data source=<server name>;user id=<user>;password=<pwd>
This ties you directly to the server. I don't like using the ODBC connection string.

4. Using SQL server enterprise manager, you need to right-click on the (local) server. On the "Security" tab, make sure "Windows and SQL authentication" is selected. This will let you create SQL users to use for your application.

Jeff
0
 
ihenryCommented:
First off, the connection string doesn't seem to be correct for odbc. Try the following connection string and see if it works.

Driver={SQL Server};Server=Aron1;Database=testdb;Trusted_Connection=yes;"
0
 
Jeff CertainCommented:
ihenry,

I'm not sure an ODBC connection string is going to work with the SQLClient objects that are being used...

Jeff
0
 
xpuser01Author Commented:
hi chaosian,
you're a genius! respect man, it works!

i don't like the odbc connection too, but until now i didn't know another way :)
i only had to modify the connection string. step4 was okay.

once again, R E S P E C T !

best regards from vienna.
0
 
ihenryCommented:
You are correct Jeff, sorry I didn't read the exception stack trace correctly. I think I need to take a break for a while :o)
0
 
Jeff CertainCommented:
ihenry,

Didn't notice it myself until I wondered why I had assumed we were using SQLClient. ;) Good old spidey-sense!

Jeff
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 4
  • 4
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now