473,396 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Windows Services and SQL Server

Greetings everyone,

I am trying to access my SQL Server 2005 database with a windows service,
the problem is that I can't access it!

It says ERROR [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'ONEWORLD\N5DALVES$'.

ONEWORLD is my domain, N5DALVES is my computer name.... the $ appears there
like magic...

in the SQL Server I don't have that user... I have ONEWORLD\DALVES...
that's my username in the intranet...

How can I avoid this? I tried to use this connection string:

DSN=MyDataSource;Uid=TimeFiveUser;Pwd=_TimeFiveUse r_;

I'm using ODBC Drivers
May 4 '07 #1
6 1747
If you are using managed code, is there any reason why you can't use the
SqlClient class with a regular SQL Server login? e.g.,
server=myserver;database=dbname;uid=user;pwd=passw ord;
--Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Diogo Alves" wrote:
Greetings everyone,

I am trying to access my SQL Server 2005 database with a windows service,
the problem is that I can't access it!

It says ERROR [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'ONEWORLD\N5DALVES$'.

ONEWORLD is my domain, N5DALVES is my computer name.... the $ appears there
like magic...

in the SQL Server I don't have that user... I have ONEWORLD\DALVES...
that's my username in the intranet...

How can I avoid this? I tried to use this connection string:

DSN=MyDataSource;Uid=TimeFiveUser;Pwd=_TimeFiveUse r_;

I'm using ODBC Drivers
May 4 '07 #2
yes there is a reason...

Where planning in the future use more than one database type... maybe oracle
and/or mysql

Since there is that option in the future we prefer to use odbc

"Peter Bromberg [C# MVP]" wrote:
If you are using managed code, is there any reason why you can't use the
SqlClient class with a regular SQL Server login? e.g.,
server=myserver;database=dbname;uid=user;pwd=passw ord;
--Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Diogo Alves" wrote:
Greetings everyone,

I am trying to access my SQL Server 2005 database with a windows service,
the problem is that I can't access it!

It says ERROR [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'ONEWORLD\N5DALVES$'.

ONEWORLD is my domain, N5DALVES is my computer name.... the $ appears there
like magic...

in the SQL Server I don't have that user... I have ONEWORLD\DALVES...
that's my username in the intranet...

How can I avoid this? I tried to use this connection string:

DSN=MyDataSource;Uid=TimeFiveUser;Pwd=_TimeFiveUse r_;

I'm using ODBC Drivers
May 4 '07 #3
There are managed providers for Oracle, MySQL and other RDBMS's. If you use
the Enterprise Library Data Access Block, these only need to be specified in
the configuration file. Your code does not have to change.
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Diogo Alves" wrote:
yes there is a reason...

Where planning in the future use more than one database type... maybe oracle
and/or mysql

Since there is that option in the future we prefer to use odbc

"Peter Bromberg [C# MVP]" wrote:
If you are using managed code, is there any reason why you can't use the
SqlClient class with a regular SQL Server login? e.g.,
server=myserver;database=dbname;uid=user;pwd=passw ord;
--Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Diogo Alves" wrote:
Greetings everyone,
>
I am trying to access my SQL Server 2005 database with a windows service,
the problem is that I can't access it!
>
It says ERROR [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'ONEWORLD\N5DALVES$'.
>
ONEWORLD is my domain, N5DALVES is my computer name.... the $ appears there
like magic...
>
in the SQL Server I don't have that user... I have ONEWORLD\DALVES...
that's my username in the intranet...
>
How can I avoid this? I tried to use this connection string:
>
DSN=MyDataSource;Uid=TimeFiveUser;Pwd=_TimeFiveUse r_;
>
I'm using ODBC Drivers
May 4 '07 #4
On May 4, 7:58 am, Diogo Alves <DiogoAl...@discussions.microsoft.com>
wrote:
yes there is a reason...

Where planning in the future use more than one database type... maybe oracle
and/or mysql

Since there is that option in the future we prefer to use odbc

"Peter Bromberg [C# MVP]" wrote:
If you are using managed code, is there any reason why you can't use the
SqlClient class with a regular SQL Server login? e.g.,
server=myserver;database=dbname;uid=user;pwd=passw ord;
--Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Diogo Alves" wrote:
Greetings everyone,
I am trying to access my SQL Server 2005 database with a windows service,
the problem is that I can't access it!
It says ERROR [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'ONEWORLD\N5DALVES$'.
ONEWORLD is my domain, N5DALVES is my computer name.... the $ appears there
like magic...
in the SQL Server I don't have that user... I have ONEWORLD\DALVES...
that's my username in the intranet...
How can I avoid this? I tried to use this connection string:
DSN=MyDataSource;Uid=TimeFiveUser;Pwd=_TimeFiveUse r_;
I'm using ODBC Drivers- Hide quoted text -

- Show quoted text -
To answer your question, it looks like you need to add the oneworld
\n5dalves$, because you're running the service as local system (or
local service) which will use the machine login. Your other option is
to run the service under a differnt user account which does have
permission to the sql server.

May 4 '07 #5
"Diogo Alves" <Di********@discussions.microsoft.comwrote in message
news:DC**********************************@microsof t.com...
Greetings everyone,

I am trying to access my SQL Server 2005 database with a windows service,
the problem is that I can't access it!

It says ERROR [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'ONEWORLD\N5DALVES$'.
Windows services that run in the "Local Service" or "Network Service"
account, authenticate using the machine account with a $ appended on the
network.
ONEWORLD is my domain, N5DALVES is my computer name.... the $ appears
there
like magic...

in the SQL Server I don't have that user... I have ONEWORLD\DALVES...
that's my username in the intranet...

How can I avoid this? I tried to use this connection string:
1. By running your service in a domain account, or
2. When running in a W2K AD domain, you can grant the machine account
(domain\machinename) access rights to the SQL Server database.
DSN=MyDataSource;Uid=TimeFiveUser;Pwd=_TimeFiveUse r_;

I'm using ODBC Drivers
Why using legacy ODBC drivers when there are managed stacks available for
most DB's systems on the market?
Willy.

May 4 '07 #6

Windows Services usually run under the

MachineName\System account. Where MachineName is your own machine name.

Thus your techincial issue.

...

Non techinical, the others are right. You should use ODBC ~only as a last
resort to talk to databases.

If you find EnterpriseLibrary (.Data) you will find a much much better
thought out solution to talking to different dbs.

"Diogo Alves" <Di********@discussions.microsoft.comwrote in message
news:DC**********************************@microsof t.com...
Greetings everyone,

I am trying to access my SQL Server 2005 database with a windows service,
the problem is that I can't access it!

It says ERROR [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'ONEWORLD\N5DALVES$'.

ONEWORLD is my domain, N5DALVES is my computer name.... the $ appears
there
like magic...

in the SQL Server I don't have that user... I have ONEWORLD\DALVES...
that's my username in the intranet...

How can I avoid this? I tried to use this connection string:

DSN=MyDataSource;Uid=TimeFiveUser;Pwd=_TimeFiveUse r_;

I'm using ODBC Drivers

May 4 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Bob Everland | last post by:
I have an application that is ISAPI and the only way to secure it is through NT permissions. I need to have a way to login to windows authentication so that when I get to the ISAPI application no...
0
by: Stefan Hinz | last post by:
Degan, jumping in to try and solve some problems that look pretty obvious to me ... > #options for default service (mysqld2) > (mysqld2) It should be , not (mysqld2).
8
by: Bill Sonia | last post by:
I've written a Windows Service to send e-mails on events like OnStart, OnStop, OnShutDown using System.Web.Mail. It works for everything but OnShutdown. My guess is that for OnShutDown, once my...
6
by: Dan V. | last post by:
Is there a way to query a remote xml file periodically by not using web services? For Windows and Unix platforms. Is there a cheap software product that I can install on each client and my Windows...
3
by: Chris Dunaway | last post by:
A quick scan of the group did not immediately reveal an answer to my questions so here goes. First let me describe my app and then I'll ask the questions. I am writing a Windows Forms App (not...
3
by: Rob | last post by:
Can a form be opened from a Windows service? I have a windows service that I would like to open a form from a notify icon. I cannot get the Notify Icon to display nor can I open a form. Any...
2
by: Jenbo | last post by:
Hi all, I have a task at the minute which involves getting data from csv files into a database and doing some nice auditing on the records in there on a web front end. The csv files are going to be...
2
by: =?Utf-8?B?dmlzaHJ1dGg=?= | last post by:
Hi, I have 2 applications running, one Windows application project and the other windows services project. I want to call my Windows application in my windows services. I want to run them as...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.