Link to home
Start Free TrialLog in
Avatar of dreinmann
dreinmannFlag for United States of America

asked on

SQL Server Login Error

Having troubles setting up a Login & User and getting it to be able to connect from a Remote computer....see error below.

It works fine when I log on to the remote cpu with the Domain\user that is the Owner of the Database in the Server.

I think it may not be the connection to the Database in the server, but maybe logging in to the server itself?
----ERROR----
System.Data.Odbc.OdbcException: ERROR [28000] [Microsoft][SQL Native Client][SQL Server]Login failed for user 'Domain\UserID'.
ERROR [28000] [Microsoft][SQL Native Client][SQL Server]Login failed for user 'USF\hz12330'.
   at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
   at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle)
   at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.Odbc.OdbcConnection.Open()

Open in new window

Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

iss the domain\userid defined in the sql server security, and is it granted permissions to the relevant database?
Avatar of dreinmann

ASKER

I just checked the 'sysadmin' box in Server Roles and it started working.

That makes it work, but thats not what I should do for a standard user, is it?
As far as the 'User Mapping', I have only the Database checked that has the information being accessed by the program, and the Public role checked in that.
what is the default database for that login?
do you specify a database in the connection string?
Connection String:
Public Shared LogManConnString As String = "Driver={SQL Native Client};Server=ServerName;Database=LogisticsManager;Trusted_Connection=yes;"

Default Database for that user is 'LogisticsManager'.  That's the one with the pertinent program info in it.
this just looks perfect.
so, there must be something else, which I don't see right now...
So, you are saying it should work with the 'sysadmin' checked?

Btw, the Login error I was getting before checking 'sysadmin' was a 'State 11'.
>So, you are saying it should work with the 'sysadmin' checked?
I mean, it should work without sysadmin being checked.

Right, sorry...mistyped.

So, I'm missing necessary Server Permissions to connect without it, right?
ASKER CERTIFIED SOLUTION
Avatar of Mark Wills
Mark Wills
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I was actually using OPENROWSET, so this confused me.

But the answer was to use a Linked Server, and set it up the way you described.

Thanks again Mark.
Know anything about Custom Bootstrapping in Visual Studio 2005?

If so, having some difficulties, see link below.

https://www.experts-exchange.com/questions/24329193/Custom-Bootstrapper-for-SQL-Native-Client-msi.html
Apologies about that, I should have remembered from your previous posting...

Openrowset can specify username and password, though, a linked server when dealing with differing domains and security is sometimes better.

As far as coding goes, trying to forget (and surprisingly easily), so might pass on that one...




That's cool.

Just posted a new one right up your alley.  Need to switch the Bulk load openrowset for csv over to a Linked Server too.   (same as this problem, except with a csv)

https://www.experts-exchange.com/questions/24333012/Cannot-bulk-load-Invalid-column-number.html