Hi,
I've created a simple sql view which is selecting date from a table in another database on same server.
Furthermore I've enabled this view in NAV, that user can read the data in a form/page.
But everytime a user tries to open this form/view he gets an Login-failure: "User ID and password are invalid"
Our users have public "right" on sql.
I've given them dbo rights on the other database but it didn't help.
When I try to access the data via Excel, everything works great.
It seems to me, that the NAV application role prevents me from accessing the external view.
Can anybody point me in the right direction how to solve the problem.
Thanks
Sebastian
0
Answers
http://msdn.microsoft.com/en-us/library/dd355092.aspx
http://www.linkedin.com/in/larswestman
thanks for your reply.
Unfortunatly our users can use tools like SQL Mgt. Studio or even hav Excel installed (it is really to easy to use excel to access the data if you are db_owner)
But I also cannot move the tables from the other database to the NAV database.
Could you please explain me a little bit more the solution of the guest account.
Where do I've to enable the account.
Is it not possible to access the remote database from NAV with a user, that has db_owner rights in the target database.
Which user/role is logging in to the other database ndo$shadow or another user/role?
Thanks in advance
Sebastian
The application role is only known in the NAV db. Imho there are no chances to access an other db with an application role.
In that situation I always try to implement a solution where only a NAS needs to access the other DB and give the NAS account db_owner role.
Another alternative is to use a linked server. You can store credentials in the linked server configuration.
Your view uses the linked server to access the other db. So the view uses the credentials of the linked server.
I really don't like that solution, but it works ...
The last alternative I'm aware of, is to implement some kind of replication.
It depends on your needs, what the best solution is.
Tobias
thanks for the detailed answer, I also believed that the ndo$shadow role is preventing us from accessing the "remote" tables.
So I'll test a little bit more, strange that is is better to put the database to another sever and create a linked server connection, than setting credentials to the view.
I'm missing some statement like
the same you can use with stored procedures.
Best regards and "einen ruhigen ersten Advent"
Sebastian
EXEC master.dbo.sp_addlinkedserver @server = N'LOCALHOST', @srvproduct=N'SQL Server'
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'LOCALHOST',@useself=N'False',@locallogin=NULL,@rmtuser=N'userWithPermission',@rmtpassword='########'
Really nasty...
Dir auch einen ruhigen ersten Advent.
Tobias
http://www.linkedin.com/in/larswestman
Tobias
But the database is on the same server. So "Linked Server" doesn't apply. Use the Guest account.