Thanks for your followup Roel.
Sure, please feel free to post here when you need any further assistance.
Good luck!
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Roel Oost" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
<
[email protected]>
<
[email protected]>
| Subject: Re: Windows service and oledb
| Date: Mon, 26 Sep 2005 09:55:19 +0200
| Lines: 119
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: 62.166.136.88
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.framework.adonet:36368
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Hi Steven,
| There I now have a working and stabil solution with SQLOLEDB the problem
| with OLEDB has no priority at the moment.
| The problem is probably related to SQL Server and OLEDB (evt. in
combination
| with our server environment) only. I do facilitate an OLEDB connection to
| Analysis Server also and that connection works fine. When the problem ever
| became actual again, I will remind your hints to discover the source of
the
| problem.
| Thanks for now,
|
| Roel Oost
| MMGuide B.V., The Netherlands
|
| | > Thanks for your response Roel,
| >
| > So from your further description on the problem, it seems the cause is
not
| > quite related to the application(service)'s security context. Also, you
| > found it works well when you swtich to .NET's SQLClient managed
provider.
| > Since you mentioned, that the Conn.Open executed fine by the returned
| > connection is closed, what did you get if you using the sql profiler to
| > trace at the SQLServer's servermachine? Currently I haven't found any
| > non-issue in internal db on using OLEDB provider for SQLServer in
windows
| > NT service. Have you tried deploying the same service on the other
server
| > to see whether you'll get the same problem?
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure!
www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| >
| >
| >
| >
| > --------------------
| > | From: "Roel Oost" <
[email protected]>
| > | References: <
[email protected]>
| > <
[email protected]>
| > | Subject: Re: Windows service and oledb
| > | Date: Fri, 23 Sep 2005 13:06:55 +0200
| > | Lines: 39
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| > | Message-ID: <
[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.adonet
| > | NNTP-Posting-Host: 62.166.136.88
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| microsoft.public.dotnet.framework.adonet:36253
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| > |
| > | I don't use windows authentication to connect to the server. The
| > connection
| > | string is something like
| > | "Provider=SQLOLEDB;Data Source=servername;Initial
| > | Catalog=dbname;uid=username;pwd=password", so guess that should be no
| > | problem. Same code in a winform or webform app works fine, but only
from
| a
| > | windows service the connection.open method behaves in described
strange
| > way
| > | (con.Open executes fine but results in a closed connection)
| > | Yes, I also wondered about using OleDb instead of SQLClient. It was an
| > | historical choice, using OleDb should be easier to use in the case the
| > | customer chooses another database to use. But that risk is almost
nihil
| at
| > | the moment.
| > | I've evaluated the behavior of the SQLClient provider in this
situation
| > and
| > | guess what, it works fine....
| > | Still wondering about why OleDb doesn't in this case. I've
configurated
| > the
| > | winservice using the LocalSystem account, a local user account and a
| > domain
| > | user account, to see if it has something to do with access to the
| database
| > | server machine (before connecting to the machine), but all same
| result...
| > | Hope to find an answer because for other connectiontypes we stille
| depends
| > | on OleDb.
| > |
| > | Roel
| > |
| > | | > | > Hi Roel,
| > | >
| > | > Welcome to MSDN newsgroup.
| > | > Regarding on the problem you mentioend, based on my experience, it
is
| > | > likely a security issue. for connecting to the SQLSERVER, what's
your
| > | > connection string? I think you're using windows authentiation so
that
| > the
| > | > application will use the process's current running account to access
| the
| > | > Remote sqlserver. Generally, for deskop applications(winform or
| > console),
| > | > the application is running under the current logon user session. For
| > | > windows NT service, they're running under a non interactive logon
| > session(
| > | > local service, NetworkService or LOCAL SYSTEM) as you specified in
the
| > | > Service control manager. And when accessing to a remote resource(on
| > | remote
| > |
| > |
| > |
| >
|
|
|