Sunday, March 11, 2012
Connection for windows authorization
server, snippet as shown:
szADOConnObjID = "ADODB.Connection";
set pADOConnObj = CreateObject(szADOConnObjID);
// Create the SQL string to complete the connection
szConnString = "driver={" + svDriver + "};";
szConnString = szConnString + "server=" + svServerName + ";";
if (g_bWinAuth = FALSE) then
szConnString = szConnString + "database=master;";
szConnString = szConnString + "uid=" + svUserName + ";";
szConnString = szConnString + "pwd=" + svUserPassword;
else // windows authorization
szConnString = szConnString + "Initial Catalog=master;";
szConnString = szConnString + "Integrated security=True";
endif;
// Open the ADO Connection
pADOConnObj.Open(szConnString);
I have no problem with the login with uid-pwd. However, if I use windows
authorization, I got the following error:
Microsoft OLE DB Service Components (0x80040E21)
Multiple-step OLE DB operation generated errors. Check each OLE DB
status value, if available.
Is my connection string correct?
TIA.Hi
I assume you can use a trusted connection from other application with this
login?
Try the connection string
Driver={SQL
Server};Server=myServerAddress;Database=myDataBase;Trusted_Connection=Yes;
as described for an ODBC connection in:
http://www.connectionstrings.com/?carrier=sqlserver
John
"Light" wrote:
> I have a vb script that uses odbc.connection that connects to the sql
> server, snippet as shown:
> szADOConnObjID = "ADODB.Connection";
> set pADOConnObj = CreateObject(szADOConnObjID);
> // Create the SQL string to complete the connection
> szConnString = "driver={" + svDriver + "};";
> szConnString = szConnString + "server=" + svServerName + ";";
> if (g_bWinAuth = FALSE) then
> szConnString = szConnString + "database=master;";
> szConnString = szConnString + "uid=" + svUserName + ";";
> szConnString = szConnString + "pwd=" + svUserPassword;
> else // windows authorization
> szConnString = szConnString + "Initial Catalog=master;";
> szConnString = szConnString + "Integrated security=True";
> endif;
> // Open the ADO Connection
> pADOConnObj.Open(szConnString);
> I have no problem with the login with uid-pwd. However, if I use windows
> authorization, I got the following error:
> Microsoft OLE DB Service Components (0x80040E21)
> Multiple-step OLE DB operation generated errors. Check each OLE DB
> status value, if available.
> Is my connection string correct?
> TIA.
>|||Hi Light,
You may try John's suggestion first. Also, I would like to know:
What is the result if you change your code for windows authentication to
the following code:
szConnString = szConnString + "database=master;";
szConnString = szConnString + "Integrated security=SSPI";
Hope this helps. Please feel free to let me know if you have any questions
or concerns.
Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================|||Hi John and Charlies,
The solution from John works but the SSPI doesn't.
As long as one of them works, I am happy. However, I would like to know the
difference between them though.
Thanks for all your helps.
Cheers.
"Charles Wang[MSFT]" <changliw@.online.microsoft.com> wrote in message
news:XyodACw4HHA.4200@.TK2MSFTNGHUB02.phx.gbl...
> Hi Light,
> You may try John's suggestion first. Also, I would like to know:
> What is the result if you change your code for windows authentication to
> the following code:
> szConnString = szConnString + "database=master;";
> szConnString = szConnString + "Integrated security=SSPI";
> Hope this helps. Please feel free to let me know if you have any questions
> or concerns.
> Best regards,
> Charles Wang
> Microsoft Online Community Support
> =====================================================> When responding to posts, please "Reply to Group" via
> your newsreader so that others may learn and benefit
> from this issue.
> ======================================================> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> ======================================================>|||Hi Light,
After I dicussed this issue with an ADO expert, this issue was related to
the driver option specified in your connection string. ODBC driver does not
recognize "integrated security" option.
If you use SQL OLEDB provider for the connection string
"Provider=sqloledb;server=CharlesXP;database=Test;Integrated
security=SSPI", it will work fine.
You may refer to:
ADO Connection Strings
http://www.codeproject.com/database/connectionstrings.asp
If you have any other questions or concerns, please feel free to let me
now. Have a nice day!
Best regards,
Charles Wang
Microsoft Online Community Support
======================================================When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================|||Thanks Charlies.
This is nice info to have.
"Charles Wang[MSFT]" <changliw@.online.microsoft.com> wrote in message
news:6WMHNf04HHA.4200@.TK2MSFTNGHUB02.phx.gbl...
> Hi Light,
> After I dicussed this issue with an ADO expert, this issue was related to
> the driver option specified in your connection string. ODBC driver does
> not
> recognize "integrated security" option.
> If you use SQL OLEDB provider for the connection string
> "Provider=sqloledb;server=CharlesXP;database=Test;Integrated
> security=SSPI", it will work fine.
> You may refer to:
> ADO Connection Strings
> http://www.codeproject.com/database/connectionstrings.asp
> If you have any other questions or concerns, please feel free to let me
> now. Have a nice day!
> Best regards,
> Charles Wang
> Microsoft Online Community Support
> ======================================================> When responding to posts, please "Reply to Group" via
> your newsreader so that others may learn and benefit
> from this issue.
> ======================================================> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> ======================================================>|||Hi Light,
I am glad to hear that the suggestions are helpful. If you have any other
qeustions or concerns, please feel free to let us know.
Have a great day!
Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================
Saturday, February 25, 2012
Connection Error
- from the Server 1 connects with MSDE server without any problem, and it is
possible to operate on without problem.
- from the Server 2 and 3 it does not connect, does not open the connection,
and gives me the following mistake:
" The server SQL Server does not exist or the access has been refused "
The only thing that I am trying to do is an Open.
The connection is throught of Internet, that is to say, to a remote IP for a
different port, but I do not deal because if from one it works from other
two not.
It does not have integrated safety.
Thank you very much for everything
Hi,can you post your connectionstring to verify that you didnt do something
like (local) or 127.0.0.1 in that which evtl. dont existson the other
servers ?!
Thanks, Jens Suessmeyer.
http://www.sqlserver2005.de
"David - SICO SL" <sicosl@.community.nospam> schrieb im Newsbeitrag
news:OSRRtG5VFHA.1384@.TK2MSFTNGP09.phx.gbl...
> Good moorning, I am testing with a MSDE and ASP.NET, comment on you a bit:
> - from the Server 1 connects with MSDE server without any problem, and it
> is possible to operate on without problem.
> - from the Server 2 and 3 it does not connect, does not open the
> connection, and gives me the following mistake:
> " The server SQL Server does not exist or the access has been refused "
>
> The only thing that I am trying to do is an Open.
> The connection is throught of Internet, that is to say, to a remote IP for
> a different port, but I do not deal because if from one it works from
> other two not.
> It does not have integrated safety.
> Thank you very much for everything
>
|||my connectionstring is:
workstation id=WEBSERVER;packet size=4096;user id=USER;data
source=80.32.XXX.XXX,1700;persist security info=false;initial
catalog=NAMEBD;password=PASS
and the webservers are in other locations, with other public IP
Thanks.
"Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de> escribi
en el mensaje news:OynIV95VFHA.3488@.TK2MSFTNGP10.phx.gbl...
> Hi,can you post your connectionstring to verify that you didnt do
something[vbcol=seagreen]
> like (local) or 127.0.0.1 in that which evtl. dont existson the other
> servers ?!
> Thanks, Jens Suessmeyer.
> --
> http://www.sqlserver2005.de
> --
>
> "David - SICO SL" <sicosl@.community.nospam> schrieb im Newsbeitrag
> news:OSRRtG5VFHA.1384@.TK2MSFTNGP09.phx.gbl...
bit:[vbcol=seagreen]
it[vbcol=seagreen]
for
>
|||"David" <sicosl@.community.nospam> schrieb im Newsbeitrag
news:udx4nt6VFHA.2572@.TK2MSFTNGP14.phx.gbl...
> my connectionstring is:
> workstation id=WEBSERVER;packet size=4096;user id=USER;data
> source=80.32.XXX.XXX,1700;persist security info=false;initial
> catalog=NAMEBD;password=PASS
> and the webservers are in other locations, with other public IP
> Thanks.
>
> "Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de>
> escribi
> en el mensaje news:OynIV95VFHA.3488@.TK2MSFTNGP10.phx.gbl...
> something
> bit:
> it
> for
>
|||Seems to me that this a network problem, the other Webservers cant reach
you data source from their location on port 1700, did you try to figure that
out ? Perhpas with a network monitoring or portscanning tool ?
"David" <sicosl@.community.nospam> schrieb im Newsbeitrag
news:udx4nt6VFHA.2572@.TK2MSFTNGP14.phx.gbl...
> my connectionstring is:
> workstation id=WEBSERVER;packet size=4096;user id=USER;data
> source=80.32.XXX.XXX,1700;persist security info=false;initial
> catalog=NAMEBD;password=PASS
> and the webservers are in other locations, with other public IP
> Thanks.
>
> "Jens Smeyer" <Jens@.Remove_this_For_Contacting.sqlserver2005.de>
> escribi
> en el mensaje news:OynIV95VFHA.3488@.TK2MSFTNGP10.phx.gbl...
> something
> bit:
> it
> for
>
Connection Error
Hi,
I have developed a program which connects to an SQL Express 2005 server. This worked fine until yesterday when the server failed. I have set up a new server, same name, config, etc and restored the data back into the database.
When the program runs it displays an error:
System.Runtime.InteropServices.COMException (0x800A0E7D): The connection cannot be used to perform this operation. It is either closed or invalid in this context.
Connection code that is erroring:
rs.Open(s, sq, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic)
* s is the search string
* sq is the connection string
sq.open("Provider=SQOLEDB;Data Source=mns-web01\sqlexpress;User ID=WLANClient;Password=password;Initial Catalog=WLAN;")
It also has a 'ghost' user which cannot be removed or re-created. This is the user which the code uses to connect to the database.
Any ideas?
Thanks
Sounds like somewhere in your code you closed or destroyed the connection, and tried to initiate an action after that. Create a simple connection test section of code with a simple select, and then try layering your other code back in. This happens a lot when you're doing looping or calling out to sub procedures.
Buck Woody
Friday, February 24, 2012
Connection Broken
Sometimes the connection may get broken, for example with laptop users.
What is the most efficient way of detecting when this happens, instead of
the string of sql errors that we get.You either implement this through your own "sanity db class" with
sending a trivial command like "Select 'Sanity Check'" to SQL Server
and doing this in a try catch block, or you wrap the command you are
trying to send in a try catch block and retry upon the specific error
class for a lost connection.
Jens K. Suessmeyer.
http://www.sqlserver2005.de
--|||Hello,
Mostly this should be because of some network issues. See if your network is
persistent..Run a ping from one of the laptop to sql server and redirect to
text file
and see if there is any request time-out..
Thanks
Hari
"Michael Tissington" <mtissington@.newsgroups.nospam> wrote in message
news:%231OsvqFoHHA.208@.TK2MSFTNGP05.phx.gbl...
>I have developed on application that connects to a sql database using
>tcp/ip
> Sometimes the connection may get broken, for example with laptop users.
> What is the most efficient way of detecting when this happens, instead of
> the string of sql errors that we get.|||There are several Framework classes that can be called to see if the Network
changes state (which kills a connection) or you can use others to see if the
SQL Server instance is still responding. Yes, it sounds like there are
network hardware (or throughput/capacity) issues.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
----
---
"Michael Tissington" <mtissington@.newsgroups.nospam> wrote in message
news:%231OsvqFoHHA.208@.TK2MSFTNGP05.phx.gbl...
>I have developed on application that connects to a sql database using
>tcp/ip
> Sometimes the connection may get broken, for example with laptop users.
> What is the most efficient way of detecting when this happens, instead of
> the string of sql errors that we get.
Connection Broken
Sometimes the connection may get broken, for example with laptop users.
What is the most efficient way of detecting when this happens, instead of
the string of sql errors that we get.
Hello,
Mostly this should be because of some network issues. See if your network is
persistent..Run a ping from one of the laptop to sql server and redirect to
text file
and see if there is any request time-out..
Thanks
Hari
"Michael Tissington" <mtissington@.newsgroups.nospam> wrote in message
news:%231OsvqFoHHA.208@.TK2MSFTNGP05.phx.gbl...
>I have developed on application that connects to a sql database using
>tcp/ip
> Sometimes the connection may get broken, for example with laptop users.
> What is the most efficient way of detecting when this happens, instead of
> the string of sql errors that we get.
|||There are several Framework classes that can be called to see if the Network
changes state (which kills a connection) or you can use others to see if the
SQL Server instance is still responding. Yes, it sounds like there are
network hardware (or throughput/capacity) issues.
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
------
"Michael Tissington" <mtissington@.newsgroups.nospam> wrote in message
news:%231OsvqFoHHA.208@.TK2MSFTNGP05.phx.gbl...
>I have developed on application that connects to a sql database using
>tcp/ip
> Sometimes the connection may get broken, for example with laptop users.
> What is the most efficient way of detecting when this happens, instead of
> the string of sql errors that we get.
Tuesday, February 14, 2012
Connecting to SQLServer 2000 from ASP.NET
The SQL Server resides on a seperate development server from the IIS5.1 on
Windows XP SP2 on development PCs which host the ASP.NET application.
I would like to use Integrated Windows Authentication like
Integrated Security=SSPI;Persist Security Info=False;Initial
Catalog=DBName;Data Source=DevServer1
My problems!
1) ASP.NET would be running on development PCs as
MachineName\IUSR_MachineName and under SQL Server Enterprise Manager on the
Dev PC, I can't think of a way to add this user (which is on a different
machine) as a Windows user
2.1) I managed to add MyDomain\AUser as a SQL user in Enterprise Manager.
2.2) I tried to get my ASP.NET to run as MyDomain\AUser by editing
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\Machine.config as
follows
<processModel
enable="true"
timeout="Infinite"
idleTimeout="Infinite"
shutdownTimeout="0:00:05"
requestLimit="Infinite"
requestQueueLimit="5000"
restartQueueLimit="10"
memoryLimit="60"
webGarden="false"
cpuMask="0xffffffff"
userName="MyDomain\AUser"
password="password"
logLevel="Errors"
clientConnectedCheck="0:00:05"
comAuthenticationLevel="Connect"
comImpersonationLevel="Impersonate"
responseDeadlockInterval="00:03:00"
maxWorkerThreads="20"
maxIoThreads="20"
/>
However, when I launch the ASP.NET application from IE (before it even get
to the stage to connect to SQLServer, I get the error on IE saying
Application Unavailable, and in the Event Viewer, I get
Event Type: Error
Event Source: ASP.NET 1.1.4322.0
Event Category: None
Event ID: 1084
User: N/A
Computer: MachineName
Description:
aspnet_wp.exe could not be started. The error code for the failure is
80004005. This error can be caused when the worker process account has
insufficient rights to read the .NET Framework files. Please ensure that the
.NET Framework is correctly installed and that the ACLs on the installation
directory allow access to the configured account.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Event Type: Error
Event Source: ASP.NET 1.1.4322.0
Event Category: None
Event ID: 1007
User: N/A
Computer: MachineName
Description:
aspnet_wp.exe could not be launched because the username and/or password
supplied in the processModel section of the config file are invalid.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
How could I fix this? I am 100% sure I have entered the correct username
and password under machine.config and I did do an iisreset as well!The problem may not be the username and password, but in the rights
MyDomain\MyUser has. For instance, I know the user has to have "Log in
as batch job" user rights. One way to track down these problems is to
turn on security auditing in the local security policy and look at
what turns up in the event log.
Another solution I have used is to let ASP.NET execute as the local
ASPNET account but set the password to a known password. In other
words, instead of:
userName="machine" password="AutoGenerate"
in machine.config, use:
userName="machine" password="longpassword"
Then on the database server, create a local ASPNET account with the
same password. For rights, you'll need "Access this computer from the
network", and "log on as batch job". You can deny local login. You'll
need to add ASPNET as a login to SQL Server and grant access to the
correct databases of course.
HTH,
--
Scott
http://www.OdeToCode.com
On Thu, 22 Apr 2004 22:49:31 +0100, "Patrick"
<patl@.reply.newsgroup.msn.com> wrote:
>I have an ASP.NET application that connects to a SQL Server database.
>The SQL Server resides on a seperate development server from the IIS5.1 on
>Windows XP SP2 on development PCs which host the ASP.NET application.
>I would like to use Integrated Windows Authentication like
> Integrated Security=SSPI;Persist Security Info=False;Initial
>Catalog=DBName;Data Source=DevServer1
>My problems!
>1) ASP.NET would be running on development PCs as
>MachineName\IUSR_MachineName and under SQL Server Enterprise Manager on the
>Dev PC, I can't think of a way to add this user (which is on a different
>machine) as a Windows user
>2.1) I managed to add MyDomain\AUser as a SQL user in Enterprise Manager.
>2.2) I tried to get my ASP.NET to run as MyDomain\AUser by editing
>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\Machine.config as
>follows
> <processModel
> enable="true"
> timeout="Infinite"
> idleTimeout="Infinite"
> shutdownTimeout="0:00:05"
> requestLimit="Infinite"
> requestQueueLimit="5000"
> restartQueueLimit="10"
> memoryLimit="60"
> webGarden="false"
> cpuMask="0xffffffff"
> userName="MyDomain\AUser"
> password="password"
> logLevel="Errors"
> clientConnectedCheck="0:00:05"
> comAuthenticationLevel="Connect"
> comImpersonationLevel="Impersonate"
> responseDeadlockInterval="00:03:00"
> maxWorkerThreads="20"
> maxIoThreads="20"
> />
>However, when I launch the ASP.NET application from IE (before it even get
>to the stage to connect to SQLServer, I get the error on IE saying
>Application Unavailable, and in the Event Viewer, I get
>Event Type: Error
>Event Source: ASP.NET 1.1.4322.0
>Event Category: None
>Event ID: 1084
>User: N/A
>Computer: MachineName
>Description:
>aspnet_wp.exe could not be started. The error code for the failure is
>80004005. This error can be caused when the worker process account has
>insufficient rights to read the .NET Framework files. Please ensure that the
>.NET Framework is correctly installed and that the ACLs on the installation
>directory allow access to the configured account.
>For more information, see Help and Support Center at
>http://go.microsoft.com/fwlink/events.asp.
>
>Event Type: Error
>Event Source: ASP.NET 1.1.4322.0
>Event Category: None
>Event ID: 1007
>User: N/A
>Computer: MachineName
>Description:
>aspnet_wp.exe could not be launched because the username and/or password
>supplied in the processModel section of the config file are invalid.
>For more information, see Help and Support Center at
>http://go.microsoft.com/fwlink/events.asp.
>How could I fix this? I am 100% sure I have entered the correct username
>and password under machine.config and I did do an iisreset as well!
>|||Hi Patrick,
How are things going currently?
I am just checking on your progress regarding the information that was sent you. Thanks for Scott's kind
help on your issue. Have you tried the solutions provided to you? I wonder how the testing is going. If you
encounter any difficulty, please do not hesitate to let us know.
The issue seems to be security related in ASP.NET. I saw you ask this question in another ASPNET queue
but not sure how are things going there.Please post here and let me know the status of your issue.
Looking forward to hearing from you soon
Best regards,
Billy Yao
Microsoft Online Support
----
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.|||Hi Patrick,
I followed with my previous post and ask if there is any headway on your side?
Per Scott's suggestion, I also believe the issue is not located in SQL Server side but in the side of the
improper rights the MyDomain\MyUser has. I'm not sure if you have implemented the following setting in
your Machine.config file:
<identity impersonate="true" userName="MyDomain\aspUser1" password="password"/>
If the ASP.NET application and SQL Server are deployed on the different machines, you may need to use
impersonate="true" to let your ASP.Net application impersonate the fixed identity.
Please let us know if this helps solve your problem.
Best regards,
Billy Yao
Microsoft Online Support
----
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.
Connecting to SQLServer 2000 from ASP.NET
The SQL Server resides on a seperate development server from the IIS5.1 on
Windows XP SP2 on development PCs which host the ASP.NET application.
I would like to use Integrated Windows Authentication like
Integrated Security=SSPI;Persist Security Info=False;Initial
Catalog=DBName;Data Source=DevServer1
My problems!
1) ASP.NET would be running on development PCs as
MachineName\IUSR_MachineName and under SQL Server Enterprise Manager on the
Dev PC, I can't think of a way to add this user (which is on a different
machine) as a Windows user
2.1) I managed to add MyDomain\AUser as a SQL user in Enterprise Manager.
2.2) I tried to get my ASP.NET to run as MyDomain\AUser by editing
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\Machine.config as
follows
<processModel
enable="true"
timeout="Infinite"
idleTimeout="Infinite"
shutdownTimeout="0:00:05"
requestLimit="Infinite"
requestQueueLimit="5000"
restartQueueLimit="10"
memoryLimit="60"
webGarden="false"
cpuMask="0xffffffff"
userName="MyDomain\AUser"
password="password"
logLevel="Errors"
clientConnectedCheck="0:00:05"
comAuthenticationLevel="Connect"
comImpersonationLevel="Impersonate"
responseDeadlockInterval="00:03:00"
maxWorkerThreads="20"
maxIoThreads="20"
/>
However, when I launch the ASP.NET application from IE (before it even get
to the stage to connect to SQLServer, I get the error on IE saying
Application Unavailable, and in the Event Viewer, I get
Event Type: Error
Event Source: ASP.NET 1.1.4322.0
Event Category: None
Event ID: 1084
User: N/A
Computer: MachineName
Description:
aspnet_wp.exe could not be started. The error code for the failure is
80004005. This error can be caused when the worker process account has
insufficient rights to read the .NET Framework files. Please ensure that the
.NET Framework is correctly installed and that the ACLs on the installation
directory allow access to the configured account.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Event Type: Error
Event Source: ASP.NET 1.1.4322.0
Event Category: None
Event ID: 1007
User: N/A
Computer: MachineName
Description:
aspnet_wp.exe could not be launched because the username and/or password
supplied in the processModel section of the config file are invalid.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
How could I fix this? I am 100% sure I have entered the correct username
and password under machine.config and I did do an iisreset as well!The problem may not be the username and password, but in the rights
MyDomain\MyUser has. For instance, I know the user has to have "Log in
as batch job" user rights. One way to track down these problems is to
turn on security auditing in the local security policy and look at
what turns up in the event log.
Another solution I have used is to let ASP.NET execute as the local
ASPNET account but set the password to a known password. In other
words, instead of:
userName="machine" password="AutoGenerate"
in machine.config, use:
userName="machine" password="longpassword"
Then on the database server, create a local ASPNET account with the
same password. For rights, you'll need "Access this computer from the
network", and "log on as batch job". You can deny local login. You'll
need to add ASPNET as a login to SQL Server and grant access to the
correct databases of course.
HTH,
Scott
http://www.OdeToCode.com
On Thu, 22 Apr 2004 22:49:31 +0100, "Patrick"
<patl@.reply.newsgroup.msn.com> wrote:
>I have an ASP.NET application that connects to a SQL Server database.
>The SQL Server resides on a seperate development server from the IIS5.1 on
>Windows XP SP2 on development PCs which host the ASP.NET application.
>I would like to use Integrated Windows Authentication like
> Integrated Security=SSPI;Persist Security Info=False;Initial
>Catalog=DBName;Data Source=DevServer1
>My problems!
>1) ASP.NET would be running on development PCs as
>MachineName\IUSR_MachineName and under SQL Server Enterprise Manager on the
>Dev PC, I can't think of a way to add this user (which is on a different
>machine) as a Windows user
>2.1) I managed to add MyDomain\AUser as a SQL user in Enterprise Manager.
>2.2) I tried to get my ASP.NET to run as MyDomain\AUser by editing
>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG\Machine.config as
>follows
> <processModel
> enable="true"
> timeout="Infinite"
> idleTimeout="Infinite"
> shutdownTimeout="0:00:05"
> requestLimit="Infinite"
> requestQueueLimit="5000"
> restartQueueLimit="10"
> memoryLimit="60"
> webGarden="false"
> cpuMask="0xffffffff"
> userName="MyDomain\AUser"
> password="password"
> logLevel="Errors"
> clientConnectedCheck="0:00:05"
> comAuthenticationLevel="Connect"
> comImpersonationLevel="Impersonate"
> responseDeadlockInterval="00:03:00"
> maxWorkerThreads="20"
> maxIoThreads="20"
> />
>However, when I launch the ASP.NET application from IE (before it even get
>to the stage to connect to SQLServer, I get the error on IE saying
>Application Unavailable, and in the Event Viewer, I get
>Event Type: Error
>Event Source: ASP.NET 1.1.4322.0
>Event Category: None
>Event ID: 1084
>User: N/A
>Computer: MachineName
>Description:
>aspnet_wp.exe could not be started. The error code for the failure is
>80004005. This error can be caused when the worker process account has
>insufficient rights to read the .NET Framework files. Please ensure that th
e
>.NET Framework is correctly installed and that the ACLs on the installation
>directory allow access to the configured account.
>For more information, see Help and Support Center at
>http://go.microsoft.com/fwlink/events.asp.
>
>Event Type: Error
>Event Source: ASP.NET 1.1.4322.0
>Event Category: None
>Event ID: 1007
>User: N/A
>Computer: MachineName
>Description:
>aspnet_wp.exe could not be launched because the username and/or password
>supplied in the processModel section of the config file are invalid.
>For more information, see Help and Support Center at
>http://go.microsoft.com/fwlink/events.asp.
>How could I fix this? I am 100% sure I have entered the correct username
>and password under machine.config and I did do an iisreset as well!
>|||Hi Patrick,
How are things going currently?
I am just checking on your progress regarding the information that was sent
you. Thanks for Scott's kind
help on your issue. Have you tried the solutions provided to you? I wonder h
ow the testing is going. If you
encounter any difficulty, please do not hesitate to let us know.
The issue seems to be security related in ASP.NET. I saw you ask this quest
ion in another ASPNET queue
but not sure how are things going there.Please post here and let me know the
status of your issue.
Looking forward to hearing from you soon
Best regards,
Billy Yao
Microsoft Online Support
----
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.|||Hi Patrick,
I followed with my previous post and ask if there is any headway on your sid
e?
Per Scott's suggestion, I also believe the issue is not located in SQL Serve
r side but in the side of the
improper rights the MyDomain\MyUser has. I'm not sure if you have implement
ed the following setting in
your Machine.config file:
<identity impersonate="true" userName="MyDomain\aspUser1" password="password
"/>
If the ASP.NET application and SQL Server are deployed on the different mach
ines, you may need to use
impersonate="true" to let your ASP.Net application impersonate the fixed ide
ntity.
Please let us know if this helps solve your problem.
Best regards,
Billy Yao
Microsoft Online Support
----
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.
Connecting to SQLServer 2000 from ASP.NET
The SQL Server resides on a seperate development server from the IIS5.1 on
Windows XP SP2 on development PCs which host the ASP.NET application.
I would like to use Integrated Windows Authentication like
Integrated Security=SSPI;Persist Security Info=False;Initial
Catalog=DBName;Data Source=DevServer1
My problems!
1) ASP.NET would be running on development PCs as
MachineName\IUSR_MachineName and under SQL Server Enterprise Manager on the
Dev PC, I can't think of a way to add this user (which is on a different
machine) as a Windows user
2.1) I managed to add MyDomain\AUser as a SQL user in Enterprise Manager.
2.2) I tried to get my ASP.NET to run as MyDomain\AUser by editing
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFI G\Machine.config as
follows
<processModel
enable="true"
timeout="Infinite"
idleTimeout="Infinite"
shutdownTimeout="0:00:05"
requestLimit="Infinite"
requestQueueLimit="5000"
restartQueueLimit="10"
memoryLimit="60"
webGarden="false"
cpuMask="0xffffffff"
userName="MyDomain\AUser"
password="password"
logLevel="Errors"
clientConnectedCheck="0:00:05"
comAuthenticationLevel="Connect"
comImpersonationLevel="Impersonate"
responseDeadlockInterval="00:03:00"
maxWorkerThreads="20"
maxIoThreads="20"
/>
However, when I launch the ASP.NET application from IE (before it even get
to the stage to connect to SQLServer, I get the error on IE saying
Application Unavailable, and in the Event Viewer, I get
Event Type: Error
Event Source: ASP.NET 1.1.4322.0
Event Category: None
Event ID: 1084
User: N/A
Computer: MachineName
Description:
aspnet_wp.exe could not be started. The error code for the failure is
80004005. This error can be caused when the worker process account has
insufficient rights to read the .NET Framework files. Please ensure that the
..NET Framework is correctly installed and that the ACLs on the installation
directory allow access to the configured account.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Event Type: Error
Event Source: ASP.NET 1.1.4322.0
Event Category: None
Event ID: 1007
User: N/A
Computer: MachineName
Description:
aspnet_wp.exe could not be launched because the username and/or password
supplied in the processModel section of the config file are invalid.
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
How could I fix this? I am 100% sure I have entered the correct username
and password under machine.config and I did do an iisreset as well!
The problem may not be the username and password, but in the rights
MyDomain\MyUser has. For instance, I know the user has to have "Log in
as batch job" user rights. One way to track down these problems is to
turn on security auditing in the local security policy and look at
what turns up in the event log.
Another solution I have used is to let ASP.NET execute as the local
ASPNET account but set the password to a known password. In other
words, instead of:
userName="machine" password="AutoGenerate"
in machine.config, use:
userName="machine" password="longpassword"
Then on the database server, create a local ASPNET account with the
same password. For rights, you'll need "Access this computer from the
network", and "log on as batch job". You can deny local login. You'll
need to add ASPNET as a login to SQL Server and grant access to the
correct databases of course.
HTH,
Scott
http://www.OdeToCode.com
On Thu, 22 Apr 2004 22:49:31 +0100, "Patrick"
<patl@.reply.newsgroup.msn.com> wrote:
>I have an ASP.NET application that connects to a SQL Server database.
>The SQL Server resides on a seperate development server from the IIS5.1 on
>Windows XP SP2 on development PCs which host the ASP.NET application.
>I would like to use Integrated Windows Authentication like
> Integrated Security=SSPI;Persist Security Info=False;Initial
>Catalog=DBName;Data Source=DevServer1
>My problems!
>1) ASP.NET would be running on development PCs as
>MachineName\IUSR_MachineName and under SQL Server Enterprise Manager on the
>Dev PC, I can't think of a way to add this user (which is on a different
>machine) as a Windows user
>2.1) I managed to add MyDomain\AUser as a SQL user in Enterprise Manager.
>2.2) I tried to get my ASP.NET to run as MyDomain\AUser by editing
>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONF IG\Machine.config as
>follows
> <processModel
> enable="true"
> timeout="Infinite"
> idleTimeout="Infinite"
> shutdownTimeout="0:00:05"
> requestLimit="Infinite"
> requestQueueLimit="5000"
> restartQueueLimit="10"
> memoryLimit="60"
> webGarden="false"
> cpuMask="0xffffffff"
> userName="MyDomain\AUser"
> password="password"
> logLevel="Errors"
> clientConnectedCheck="0:00:05"
> comAuthenticationLevel="Connect"
> comImpersonationLevel="Impersonate"
> responseDeadlockInterval="00:03:00"
> maxWorkerThreads="20"
> maxIoThreads="20"
> />
>However, when I launch the ASP.NET application from IE (before it even get
>to the stage to connect to SQLServer, I get the error on IE saying
>Application Unavailable, and in the Event Viewer, I get
>Event Type: Error
>Event Source: ASP.NET 1.1.4322.0
>Event Category: None
>Event ID: 1084
>User: N/A
>Computer: MachineName
>Description:
>aspnet_wp.exe could not be started. The error code for the failure is
>80004005. This error can be caused when the worker process account has
>insufficient rights to read the .NET Framework files. Please ensure that the
>.NET Framework is correctly installed and that the ACLs on the installation
>directory allow access to the configured account.
>For more information, see Help and Support Center at
>http://go.microsoft.com/fwlink/events.asp.
>
>Event Type: Error
>Event Source: ASP.NET 1.1.4322.0
>Event Category: None
>Event ID: 1007
>User: N/A
>Computer: MachineName
>Description:
>aspnet_wp.exe could not be launched because the username and/or password
>supplied in the processModel section of the config file are invalid.
>For more information, see Help and Support Center at
>http://go.microsoft.com/fwlink/events.asp.
>How could I fix this? I am 100% sure I have entered the correct username
>and password under machine.config and I did do an iisreset as well!
>
|||Hi Patrick,
How are things going currently?
I am just checking on your progress regarding the information that was sent you. Thanks for Scott's kind
help on your issue. Have you tried the solutions provided to you? I wonder how the testing is going. If you
encounter any difficulty, please do not hesitate to let us know.
The issue seems to be security related in ASP.NET. I saw you ask this question in another ASPNET queue
but not sure how are things going there.Please post here and let me know the status of your issue.
Looking forward to hearing from you soon
Best regards,
Billy Yao
Microsoft Online Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.
|||Hi Patrick,
I followed with my previous post and ask if there is any headway on your side?
Per Scott's suggestion, I also believe the issue is not located in SQL Server side but in the side of the
improper rights the MyDomain\MyUser has. I'm not sure if you have implemented the following setting in
your Machine.config file:
<identity impersonate="true" userName="MyDomain\aspUser1" password="password"/>
If the ASP.NET application and SQL Server are deployed on the different machines, you may need to use
impersonate="true" to let your ASP.Net application impersonate the fixed identity.
Please let us know if this helps solve your problem.
Best regards,
Billy Yao
Microsoft Online Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.
Sunday, February 12, 2012
Connecting to SQL Server via a Lan Connection
Private con As New SqlConnection("Data Source=(local);trusted_connection=true;Initial Catalog=Database1")
This works fine for running locally but I need to give my Windows form application to other users on the lan and have them reach my database server. So next I tried:
Private con As New SqlConnection("WorkStation ID= E134017.nw.nos.Boeing.com;Data Source=(local);trusted_connection=true;Initial Catalog=Database1")
where E134017.nw.nos.boeing.com is the full network path to my computer
It does not work and results in "Server does not exist or access is denied"
I next went in SQL and turned on tcp/ip and still no luck.
Any ideas,
Fred
Hi FredI think you have to change your Data source in the connection string to the Server Name (PC Name that the SQL server is installed on)
i.e.
Private con As New SqlConnection("Data Source=FredPC;trusted_connection=true;Initial Catalog=Database1")
Friday, February 10, 2012
Connecting to SQL Server database via windows form app
Private con As New SqlConnection("Data Source=(local);trusted_connection=true;Initial Catalog=Database1")
This works fine for running locally but I need to give my Windows form application to other users on the lan and have them reach my database server. So next I tried:
Private con As New SqlConnection("WorkStation ID= E134017.nw.nos.Boeing.com;Data Source=(local);trusted_connection=true;Initial Catalog=Database1")
where E134017.nw.nos.boeing.com is the full network path to my computer
It does not work and results in "Server does not exist or access is denied"
I next went in SQL and turned on tcp/ip and still no luck.
Any ideas,
Fred
The good way of doing this, at least in my opinion is to kepp the connectin string in App.Config file, thus you can chage it without bother to compile again.so you'll have something like
<configuration>
<add key="ConnectionString" value="server=(local);trusted_connection=yes;database=b1;"/>
</configuration>
when you copy the application to another workstation, you can change the connection string to server=DB_SERVER_NAME;trusted_connection=yes;database=b1;", where DB_SERVER_NAME is the name of the cmputer where the SQL Server is or the one that you refer to local. Then you have to add the remote users into your database server and grant access to db1.|||Your connection string is looking for a SQL Server on the user's workstation. Don't you want to change your Data Source property to point to the name of your database server?
Darrel|||that's the reason i explain in the 2nd paragraph to replace the DB_SERVER_NAME appropriately.|||Ok, this is the connection string I am using
Data Source = \\E134017.nw.nos.boeing.com;Trusted_Connection=True;Initial Catalog=Database1
\\E134017.nw.nos.boeing.com is the full path to the server computer. E134017 is the computer name.
Using this connection string, I go to another computer on the network and login and try to reach my server thru my connection string.
I get"Server does not exist or access is denied"
That same connection string works fine as a login on the server itself.
I am lost.
Fred|||
The SQL forum is a better venue for your question.
|||This is the connection string we use in our Winapps:Data Source=<Your server name here>;user id=<your user ID here>;password=<users Password here>;initial catalog=<Database name here>
Hope this helps
Deasun|||then use this
server=E134017;trusted_connection=yes;database=Database1;