ODBC Linking

D

Domac

Hi,

I need to link a view from Sql Server 2000 .
When I link tables using my Dynamic linking routine, I've stored username
and password in a connect string in my "Profiles" tables from where I get
Source table, Destination table and Connect string .

here is an example:

ODBC;DRIVER=SQL
Server;SERVER=MYSERVER;UID=satlos;PWD=satlos;
WSID=HOSTNAME;DATABASE=Tlos2006

Problem is pretty specific :

On Sql Server I have specific table that contains list of Warehouse IDs
allowed to view for logged user.

WarehouseID UserName
1 satlos
2 satlos
3 satlos
4 satlos
5 satlos
6 satlos
1 user1
2 user2

Then to filtrate WarehouseID for current logged user I have a view :

SELECT * from dbo.WarehouseRights
WHERE dbo.WarehouseRights.Username = USER_NAME()

That is why is very important wich user is log on.

So, depending on username (user department determines from wich warehouses)
Stock on hand will see.

Goal is that USER_NAME() function must return "satlos".

How to save username and password into tabledef object??
Both are used in connect string when linking tables at application start!

How to be sure that user is exactly "satlos" because view will return
"empty" recordset!

Thanks a lot!

Domac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top