Re: Windows service and oledb

Tech-Archive recommends: Fix windows errors by optimizing your registry



Make sure that you're trapping all exceptions and the target server is setup
to support mixed mode security--it defaults to SSPI only. I would avoid use
of OleDb when connecting to SQL Server. It's slower, and is COM-dependant.
SqlClient is THE interface to use. Just because you're using OleDb, you
won't be able to port your application over simply by changing provider
names. It's never that simple.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
www.sqlreportingservices.net
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________


"Roel Oost" <roeloost@xxxxxxxxxxxxx> wrote in message
news:etShZ6CwFHA.3588@xxxxxxxxxxxxxxxxxxxxxxx
>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
>
> "Steven Cheng[MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
> news:CitzIRCwFHA.3020@xxxxxxxxxxxxxxxxxxxxxxxx
>> 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
>
>


.



Relevant Pages

  • Re: as/400 http server
    ... I am connecting with oledb to get the data. ... "Lucas Tam" wrote: ... > You can't run an ASP.NET page directly on an AS/400 server, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Forms authentication - change password
    ... Contact the server administrator. ... I think your authentication validation method needs to be set to ... the change password feature within ISA ... | | meant not connecting to a Global Catalog. ...
    (microsoft.public.isa)
  • Re: SBS Slow user logons problem
    ... Microsoft MVPs ... Are the workstations and Server all connecting their nics to a router? ...
    (microsoft.public.windows.server.sbs)
  • Re: SBS Slow user logons problem
    ... Microsoft MVPs ... Are the workstations and Server all connecting their nics to a router? ...
    (microsoft.public.windows.server.sbs)
  • Re: Outlook RPC over HTTP
    ... Now its checked it does not connect VPN ... In case it matters i have gone into IIS on the Server and checked the ... Proxy Setttings: ... mutually authenticate the sesssion when connecting with SSL: ...
    (microsoft.public.windows.server.sbs)