303factory
Registered User.
- Local time
- Today, 15:18
- Joined
- Oct 10, 2008
- Messages
- 136
Hi
I need to be able to vary the connection string in a query depending on who is logged in (I'm using SQL Server 2005 back end to my access client).
I have a function getConnectionString which generates teh connection string depending on the logged in user and the required database, but I'm not sure how to code this into the query. I tried setting the connection string property to 'getConnectionString("myDatabase")' but when you try to open the query it says 'not a valid file name'
the query code is as such:
I need to be able to vary the connection string in a query depending on who is logged in (I'm using SQL Server 2005 back end to my access client).
I have a function getConnectionString which generates teh connection string depending on the logged in user and the required database, but I'm not sure how to code this into the query. I tried setting the connection string property to 'getConnectionString("myDatabase")' but when you try to open the query it says 'not a valid file name'
the query code is as such:
Code:
SELECT tblStaff.ID, tblStaff.UserID
FROM tblStaff IN '' [getConnectionString("MIDSQLKB")]
ORDER BY tblStaff.UserID;
Any ideas what I'm doing wrong here?
thanks
303
Last edited: