Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open rowset syntax help 1

Status
Not open for further replies.

twifosp

Programmer
Jul 25, 2003
186
US
Hi, trying to get an open rowset right. I can get it to work if I use a login, but I want to use NT auth.

This works:
Code:
select  a.*
(from	openrowset ('SQLOLEDB',server;'login';'password',
	'select * from table') as a

This does not:
Code:
select *
from   openrowset('SQLOLEDB', 'Trusted_Connection= yes;Data Source=server;', 'select * from table') as a

I get "Login failed for user 'SYSTEM'.
[OLE/DB provider returned message: Invalid connection string attribute]" when I try trusted connection.

What am I doing wrong?
 
Have you tried Integrated Security=SSPI; ?

Also specify default database (Initial Catalog=blah;)
 
Thanks for the response. Didn't work. String now looks like:

Code:
select *
from   openrowset('SQLOLEDB', 'Trusted_Connection= yes; Integrated Security=SSPI; Data Source=server; Initial Catlog = database;', 'select * from table') as a

Getting same error message.
Login failed for user 'SYSTEM'.
[OLE/DB provider returned message: Invalid connection string attribute]
 
Remove extra spaces between properties and values (Trusted_Connection=Yes for example), check for typos (Initial Catalog) then try again...
 
Bah, owned by typing. Sorry I didn't catch that. Works now, thanks vongrut you da man.

Fyi, didn't need the initial catalog, just the extra integrated security=sspi.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top