Sunday, March 11, 2012
Connection to SQL Server with network login id when not logged
stuff, every morning connects to a SQL Server that requires a login by
network login id. The problem is that, even if that scheduled task runs
as the network user, it doesn't work if that user is not logged on.
Is it any way to make ir connect when not logged?
Thanks in advance.
By "scheduled task" I assume that to mean that it is set to run using SQL
Agent. If so, then you need to assign the SQL Agent service to run as a
specific windows domain id and that id in turn needs to be granted access to
your SQL Server instance and database(s).
--Brian
(Please reply to the newsgroups only.)
<axl@.todojuegos.com> wrote in message
news:1123149165.623223.184430@.g44g2000cwa.googlegr oups.com...
> I have a scheduled task that executes a program that, among other
> stuff, every morning connects to a SQL Server that requires a login by
> network login id. The problem is that, even if that scheduled task runs
> as the network user, it doesn't work if that user is not logged on.
> Is it any way to make ir connect when not logged?
> Thanks in advance.
>
Connection to SQL Server with network login id when not logged
stuff, every morning connects to a SQL Server that requires a login by
network login id. The problem is that, even if that scheduled task runs
as the network user, it doesn't work if that user is not logged on.
Is it any way to make ir connect when not logged?
Thanks in advance.By "scheduled task" I assume that to mean that it is set to run using SQL
Agent. If so, then you need to assign the SQL Agent service to run as a
specific windows domain id and that id in turn needs to be granted access to
your SQL Server instance and database(s).
--Brian
(Please reply to the newsgroups only.)
<axl@.todojuegos.com> wrote in message
news:1123149165.623223.184430@.g44g2000cwa.googlegroups.com...
> I have a scheduled task that executes a program that, among other
> stuff, every morning connects to a SQL Server that requires a login by
> network login id. The problem is that, even if that scheduled task runs
> as the network user, it doesn't work if that user is not logged on.
> Is it any way to make ir connect when not logged?
> Thanks in advance.
>
Connection to SQL Server database
Initially I was using Windows Authentication with Impersonation turned on. This let me connect to the database no problem.
However, I decided to change my method of connecting to the database for performance reasons but now I get this error.
I store my connection string in web.config and it looks like this:
<appSettings>
<add key="ConnectionString" value="server=server;
Database=dbname;Connect Timeout=15;Network Library=dbmssocn;uid=username;password=userpassword"/>
</appSettings>
Further down in the web.config file I still have this:
<authentication mode="Windows" /
<authorization>
<allow users="nameofusergroup" />
<deny users="?" />
</authorization
<identity impersonate="true" />
Any ideas why I would be able to connect to the database using impersonation and not when I explicity give the crudentials in the connection string?
Regards
Wallaceprobably SQL Server isn't configured for SQL Authentication. just windows.
Saturday, February 25, 2012
Connection switching to "sa" login
I have seen some strange behaviour where a connection flips from the login it connected with to use "sa".
I have evidence of this captured in a .trc file, where you can see a particular SPID being used (via Management Studio) under a windows login, then for some reason the login name changes to "sa" for a couple of queries, then changes back to the windows login.
Has anyone else noticed behaviour like this? It's starting to cause me real hassle as it shows up on our Audit reports, when we're only supposed to use "sa" in emergencies only.
Could you please file a defect report for this on the Connect site (http://connect.microsoft.com/sqlserver)? Defects reported by customers on the Connect site go directly into our internal defect tracking system so we don't lose any information. Also, customer reported issues have additional weight with the development team when we are prioritizing future work.
If possible, try to come up with a compact set up steps that illustrate the issue on a sample database such as AdventureWorks or Northwind. That will make it much easier for us to figure out what is going on. Attaching a .trc file might help as well if the problem queries are coming from a dialog or other UI (other than the query editor).
Thanks,
Steve
Have you disabled SA account on your server?
What are privileges for the SQL Server services account?
Connection string with sa password
Server has password for sa login. The VB code for connection is next:
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection
Conn.ConnectionTimeout = 30
Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;Initial Catalog=master;Data
Source=server;Password=mypassword;
Conn.Open
Connection performs successfully but after that Conn.ConnectionStrring
value has changed and equals
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
Data=False;Tag with column collation when possible=False
There is no any information about sa password which is not blank.
Connection object Conn is a global object in my application which is
used after, so I get a error
Login failed for user sa
How can I save my sa password in connection string?First of all, you shouldn't be using 'sa' to connect to SQL Server, from
your applications. This is a security threat, as 'sa' happens to be a
powerful login.
Then, you should be either using a DSN, or store your connection string
somewhere (Global.asa may be?), so that it is there at a specific location,
and that it never changes.
--
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Vadim Bulat" <bulat@.asuxxivek.spb.ru> wrote in message
news:7e1d1f98.0407150731.78249213@.posting.google.com...
> My application designed with VB6.0 is connected to MS SQL Server 7.0.
> Server has password for sa login. The VB code for connection is next:
> Dim Conn As ADODB.Connection
> Set Conn = New ADODB.Connection
> Conn.ConnectionTimeout = 30
> Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
> Info=False;User ID=sa;Initial Catalog=master;Data
> Source=server;Password=mypassword;
> Conn.Open
> Connection performs successfully but after that Conn.ConnectionStrring
> value has changed and equals
> Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
> Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
> Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
> Data=False;Tag with column collation when possible=False
> There is no any information about sa password which is not blank.
> Connection object Conn is a global object in my application which is
> used after, so I get a error
> Login failed for user sa
> How can I save my sa password in connection string?
Connection string with sa password
Server has password for sa login. The VB code for connection is next:
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection
Conn.ConnectionTimeout = 30
Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
Info=False;User ID=sa;Initial Catalog=master;Data
Source=server;Password=mypassword;
Conn.Open
Connection performs successfully but after that Conn.ConnectionStrring
value has changed and equals
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
Data=False;Tag with column collation when possible=False
There is no any information about sa password which is not blank.
Connection object Conn is a global object in my application which is
used after, so I get a error
Login failed for user sa
How can I save my sa password in connection string?
First of all, you shouldn't be using 'sa' to connect to SQL Server, from
your applications. This is a security threat, as 'sa' happens to be a
powerful login.
Then, you should be either using a DSN, or store your connection string
somewhere (Global.asa may be?), so that it is there at a specific location,
and that it never changes.
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Vadim Bulat" <bulat@.asuxxivek.spb.ru> wrote in message
news:7e1d1f98.0407150731.78249213@.posting.google.c om...
> My application designed with VB6.0 is connected to MS SQL Server 7.0.
> Server has password for sa login. The VB code for connection is next:
> Dim Conn As ADODB.Connection
> Set Conn = New ADODB.Connection
> Conn.ConnectionTimeout = 30
> Conn.ConnectionString = Provider=SQLOLEDB.1;Persist Security
> Info=False;User ID=sa;Initial Catalog=master;Data
> Source=server;Password=mypassword;
> Conn.Open
> Connection performs successfully but after that Conn.ConnectionStrring
> value has changed and equals
> Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
> Catalog=master;Data Source=retiv;Use Procedure for Prepare=1;Auto
> Translate=True;Packet Size=4096;Workstation ID=USER;Use Encryption for
> Data=False;Tag with column collation when possible=False
> There is no any information about sa password which is not blank.
> Connection object Conn is a global object in my application which is
> used after, so I get a error
> Login failed for user sa
> How can I save my sa password in connection string?
connection string with authenticated user info
Hi. New to ASP.NET and first time posting.
My web app connects to a SQL database - SQL authentication.
Users login to the web app through the login server control. Once authenticated, it is my understanding that the user name and password are stored on the client as a cookie.
How do you programmatically get this user info and use it for the userid and password parameters of the connection string?
Is there a better way to use the authenticated user info to access a SQL database?
Thanks
Once authenticated (using asp.net login control), you can get the user info programmatically using:
Page
.User.Identity ( for example,Page.User.Identity.Name returns the username )|||Thanks for the info.
I did some reading on Page.User.Identity, but don't understand how to get the password used for login. I need both the username and password to authenticate in SQL server.
Sunday, February 19, 2012
Connection String and login problems?
I am trying to connect to a local SQL Express database via an ASP website using the below connection string
Provider=SQLNCLI;Server=.\S15XXXX;Database=thenameofdb;Trusted_Connection=yes;
But I am getting the following error...
Microsoft SQL Native Client
Cannot open database "thenameofdb" requested by the login. The login failed.
I thought as I am using a trusted connection I didn't need to login? Have I got the connection string wrong? any help very much appreciated... Thanks
All sorted...
I just needed to add IUSR to the DB
Friday, February 10, 2012
connection problem
i'm having a problem with my web aplication. I'm using a net 2.o login in my apliction and mssql express 2K3 server and app_data i have the aspnetdb where are logins for page. When i'm usinng a web form in localhost works fine but from the internet i'm getting a error :
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
This is just a piece of error, have anyone some idea what's wrong?It sounds like your aspnet app is using windows authentication which in the context of the Internet would only work if you assign your web server's logon account access. See http://support.microsoft.com/default.aspx?scid=kb;en-us;247931&Product=sql2k for more information.
Derek
|||did you resolve your connection issue? and if so please mark an answer.|||No i didn't. I believe the problem is combination the mssql express and 2k3, because on my win xp server the aplication works normal without any problems. Have somebody any experiences about that to?|||OK! problem solves, i found a solution in another post, tnx anyway :)|||Could you please next time crosslink the answer to this post, as if another person will search for the answer to your problem he will find it faster.
HTH, Jens SUessmeyer.
http://www.sqlserver2005.de
I found a solution on this post : http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=130715&SiteID=1&PageID=1
connection problem
Dear sir,
i have a problem with my sql server database that every time logged in the database on
my web server as login system , the error has occured .
The ERROR is
microsoft ole db ms sql server not logged as localhost/i_userlocalhost , so why this problem occurs.
i am watitng for your response.
thanking you,
saquib qureshi