x

SQL server 2005 in VC++ using CLI

Message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user ''. The user is not associated with a trusted SQL Server connection. SQLSTATE: 28000

This error is occurred in SQLDriverConnect method

connString= "DRIVER={SQL Server Native Client 10.0};SERVER=IPofServer\SQLEXPRESS;DATABASE=DBName;Trusted_Connection=yes;";

SQLDriverConnect (sqlconnectionhandle , NULL , (SQLCHAR*)connString , SQL_NTS , retconstring , 1024 , NULL , SQL_DRIVER_NOPROMPT ));

I m Using Remote Database means Database is on server and client is on another host(Machine)

Please help

Thanxs in Advance
more ▼

asked Apr 07 '12 at 05:04 AM in Default

sanj_love89 gravatar image

sanj_love89
0 1 1 1

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first
This is probably down to your user ID (or the user ID under which the application is running) hasn't been granted access to the SQL Server to which you are trying to connect. "Trusted_Connection" means that the SQL Server is using your Active Directory credentials to connect, rather than using a SQL Server user name / password.
more ▼

answered Apr 07 '12 at 09:22 PM

ThomasRushton gravatar image

ThomasRushton ♦
33.4k 14 20 44

(comments are locked)
10|1200 characters needed characters left

Thanxs Thomas Rushton

But how to granted access to the SQL Server to which Client trying to connect
more ▼

answered Apr 09 '12 at 05:07 AM

sanj_love89 gravatar image

sanj_love89
0 1 1 1

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1936
x20
x2

asked: Apr 07 '12 at 05:04 AM

Seen: 1178 times

Last Updated: Apr 09 '12 at 05:07 AM