[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

Hello All,

I'm Getting the following error when calling a dll from my vb.net application.
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
The dll was written in vb6 and accesses a sql db using the following connection string.
Public Const GLOBAL_DNS As String = "DSN=TransSrvFinal;UID=sa;PWD=admin;"
This DLL works fine when called from other Windows Apps. However I'm now trying to call this dll from with in an asp.net application. I'm using vb.net as the codebehind.
I'm assuming I need to somehow setup vb to gain access to the sql server but I'm not sure how to go about doing this. Can someone please help me? Also, why doesn't this work this way?
Thanks in advance.
Tim Thomas
-1
tthomasol
3/1/2004 2:57:40 AM
asp.net.visual-basic.net 3721 articles. 0 followers. Follow

7 Replies
1708 Views

Similar Articles

[PageSpeed] 49

Try making a more accurate connection string

Open notepad
Make a new text file
Hit save as
Change save as type to "All Files"
save it as whatever.udl
rem. where you saved it and open it in explorer and setup your connection details, test it there.
Reopen the file in notepad
Delete the "Provider=SQLOLEDB.1;" part of the connection string
Use this in your app as the connection string...
Should work, long as it did in the wizard ;).
BTW if your using MS SQL Server why are you using the ODBC connecter? use the built in SQL Connecters they are up to 70% faster than the ODBC varient.
Infinity Squared Technologies

The Infinite Idea Company (TM)

http://www.thinkist.net



*NOTE* My views express the views of me and not Infinity Squared Technologies...
-1
frazell
3/1/2004 3:57:59 PM
Thanks for the response Frazell!

I got over the connection issue and I also implemented the MS SQL connection instead of ODBC. What a difference! Thanks so much for your advice!
My latest problem is that the dll being called by my VB/ASP.NET app makes use of another dll that is stored on a mapped drive. Now I'm getting the following error when the dll attempts to call it's counterpart.
System.IO.FileNotFoundException: File not found: t:\ShareDLL\Special.dll
The file is there and the dll I'm using to invoke this call works when I call it from other Windows Apps. Do you have any advice?

Tim Thomas
1
tthomasol
3/3/2004 5:54:33 PM
ASP.NET operates in a "least privilaged" account which dosent allow your application (you can modify this but unless its dead needed i dont recommend it) to operate with many permissions, acessing the network is one of those not allowed. I recommend you copy the .dll into the applications bin folder or set VS to do that for you.

This greatly reduces your attack surface if your server is comprimised thru your application.
Infinity Squared Technologies

The Infinite Idea Company (TM)

http://www.thinkist.net



*NOTE* My views express the views of me and not Infinity Squared Technologies...
1
frazell
3/3/2004 7:15:38 PM
Thanks again for your response Frazell,

I followed your instructions and loaded the dll in question locally. This took care of my problem and I can continue to develope my project. However when we go live with this I will need to be using the shared location for this dll because of licensing restrictions on the dll in question. Is there some way for me to give my .net application access to our shared T drive?
Thanks,
Tim
Tim Thomas
0
tthomasol
3/4/2004 4:55:34 PM
This document will explain how to change process identity for your ASP.NET app. But as i warned earlier really try to take security into mind.

http://docs.aspng.com/quickstart/aspplus/doc/procmodel.aspx
Infinity Squared Technologies

The Infinite Idea Company (TM)

http://www.thinkist.net



*NOTE* My views express the views of me and not Infinity Squared Technologies...
0
frazell
3/5/2004 2:02:12 PM
Thanks for all your help Frazell!
Tim Thomas
0
tthomasol
3/5/2004 4:52:48 PM
Never a problem ;)
Infinity Squared Technologies

The Infinite Idea Company (TM)

http://www.thinkist.net



*NOTE* My views express the views of me and not Infinity Squared Technologies...
0
frazell
3/5/2004 6:04:04 PM
Reply:

Similar Artilces:

2008 IIS7 connection to SQL Server 2000 on Web Server 2000: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
I am setting up a windows 2008 IIS7 web server, and trying to connect to a windows 2000 sql server 2000 database. I have an IIS6 Windows 2000 web server activately connected just fine. I have anonymous and windows authentication enabled. And in my web.config I have identity impersonate="true" My sql server 2000 typically uses the IISUSER anonymous user set up in IIS6 on my original windows 2000 web server. But this new IIS7 is giving me grief. I can't seem to setup the IUSR or IISUSER or anything in it. I can't even use sql server credentials in my connection string altho...

[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database requested in login 'WinFM SQL PFS'. Login fails.
HiASP pages were properly connecting to SQL DB until I restored from a backup DB.  As soon as I finished restoring from the backup DB, I am getting the following error message.   I did not make any changes on ASP side.  IIS Server and SQL 2K Server is running on a WIN2K Server Box.Please help.Thank you.HTTP 500.100 - Internal Server Error - ASP errorInternet Information ServicesTechnical Information (for support personnel)Error Type:Microsoft OLE DB Provider for ODBC Drivers (0x80004005)[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database requested in login...

Login failed for user 'Bachelorplace'. The user is not associated with a trusted SQL Server connection. (.Net SqlClient Data Provider)
please tellme how to resolve this error, i m using server studio management tool. and trying to connect using sql server authentication. my pc is over a domain.   Login failed for user 'Bachelorplace'. The user is not associated with a trusted SQL Server connection. (.Net SqlClient Data Provider)  check whether that sql server is allowing sqlauthentication or not.select that server -> right click it-> select  properties  -> in the window, select security -> check what is the server authentication. it should be  sqlserver and windows authentica...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
After sucessful installation of portal Starter kit, Portal Database was created and portaluser was the new login created. but when i tried to access the portalVBSDK on my PC this error is displayed. Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Login failed for user '(null)'. Rea...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
hi all. This is my first web form,and I am trying to conenct to a table in Ms SQL Server. when I run my program I got the followin error message: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. I am using windows 2000 authentication. How can I fix it ? Thanks jsn hello, u need to privde a username and password for the SQL server that you are using !!!Bilal Hadiar, MCP, MCTS, MCPD, MCTMicrosoft MVP - Telerik MVP 1. Open IIS, right-click on the virtual directory for your site and click on Properties. 2. Click the Dire...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Hello, I have installed DotNetNuke on my computer and did everything they said in the Configuration. But when I want to start http://localhost/DotNetNuke I receive an error: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. What is this. There is a Datavbase called DotNetNuke in SQL-Server gr. miles You have to have a user assigned to the database and use those credentials in you connection string (web.config)...~ChrisNet Data Design706Horsman.us This is a sql/msde authentication issue. Your web.config is using windows authent...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection
Dear All,I am trying to establish a connection to my SQL Server which is on the Remote machine. My ASP.Net application is on the local machine. Below is my connection string: <appSettings><add key="NorthConn" value="server=ABC;integrated security=sspi;database=Northwind"/></appSettings>The North wind Database has the following user accounts:1) ABC\ASPNET2)ABC\IUSR_ABCboth of these accounts have permissions granted to them.My SQL Server has both Windows and SQL Server authentication checked. I checked the properties of my  web project in IIS  and it has both Anony...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection
I dont believe that no one can help me in this damn error,Please, I'm gonne lose my job offer If I didnt fix this. I have spent 7 days searching with no use !! I use ASP.NET 2.0 with C# to develop an intranet site, it was working perfectly when i was on Visual Studio, when i tried to publish the site it gave me that error. Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. the web application on IIS server, windows 2003 - the database on a different server windows 2003, sql server 2000. Regaeding that we have proxy server, one fi...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Came in this morning and im getting the following error in our Provisioning tool. This was working as of yesterday and no changes were made to the web.config file. Ive failed over the cluster on the sql servers and also restarted the provisioning engine. Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. The SQL server is setup for mixed mode authentication and ive opened my web.config file with visual studio and can make a connection with the same sql user and pass thats in my web.config to the proper databases.  The provisioning se...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
This code is giving me this error using System; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Text;     namespace WebApplication1 { /// <summary> /// Summary description for WebForm1. /// </summary> public class WebForm1 : System.Web.UI.Page { private void Page_Load(object sender, System.EventArgs e) { SqlConnection con; string sql; SqlDataAdapter adExisting; //con = new SqlConnection("Data Source=slon12d11012";User ID=nnichol1;); //con = new SqlConnection("Initial Catalog=DACari;Data Source=slon12d1101...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Can anyone tell me why I get this error message and how to fix it? Thanks, Scott I would guess that it is because your SQL server is set up for windows authentication rather than mixed mode, and that your ASPNET account doesn't have a corresponding SQL server account. Jeff MartinMCSD C# .NEThttp://www.jeffmartin.com I found this method of changing modes on another site, and it helped me a lot. You can change the authentication to "SQL Server and Windows" by changing this registry setting: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer LoginMode = ...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection
Hi i installed msde with follwoing attributes for a project DotnetNUke..C:\sql2ksp3\MSDE\>Setup.exe SAPWD="password "INSTANCENAME="DNNV3" SECURITYMODE=SQLin my web.config file here is what i am using==><appSettings>    <add key="SiteSqlServer" value="Server=(local);Database=DNNV3;uid=;pwd=password;" />   but i am getting below error...can anyone PLEASE help me on this.thanks a lotInstalling DotNetNukeUpgrade Error: ERROR: Could not connect to database specified in connectionString for SqlDataProvider   ---------------------------------------------...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
 Hmmm.... I have been developing a site on my local machine and it all works there. When I push it to the web-server it does not. I have used connection strings in my web.config file that look like this (the names have been changed to protect the innocent.. or me...) <add name="TDemoSiteConnectionString" connectionString="Data Source=192.168.8.37;Initial Catalog=TDemoSite;Persist Security Info=True;User ID=TDemo;Password=fred" providerName="System.Data.SqlClient" /> When I call a table adapter I get the error 'login failed for user null'. W...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection #4
I dont believe that no one can help me in this damn error,Please, I'm gonne lose my job offer If I didnt fix this. I have spent 7 days searching with no use !! I use ASP.NET 2.0 with C# to develop an intranet site, it was working perfectly when i was on Visual Studio, when i tried to publish the site it gave me that error. Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. the web application on IIS server, windows 2003 - the database on a different server windows 2003, sql server 2000. Regaeding that we have proxy server, one ...

Web resources about - [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. - asp.net.visual-basic.net

Resources last updated: 12/2/2015 2:58:11 PM