no prompt on linked table

From: geobier (geobier_at_discussions.microsoft.com)
Date: 02/02/05


Date: Wed, 2 Feb 2005 07:49:04 -0800

I am hoping that someone might know a way to turn off the SQL Server Login
prompt and instead have an error returned immediately when trying to open a
recordset to a linked table (linked from the mdb file to the SQL Server
Logon).

Specifically, I am doing the following (this is c# code using dao interop)

m_daoDatabase = m_daoDBEngineClass.OpenDatabase("foo.mdb", -1, -1, "");

followed by the opening of a recordset against dbo_JTEST where dbo_JTEST is
a linked SQL Server table:

m_daoRecordset = m_daoDatabase.OpenRecordset(
"Select * from dbo_JTEST", DAO.RecordsetTypeEnum.dbOpenDynaset,
DAO.RecordsetOptionEnum.dbSeeChanges | DAO.RecordsetOptionEnum.dbForwardOnly,
DAO.LockTypeEnum.dbOptimistic);

This will bring up a SQL Login dialog because dbo_JTEST is a linked table
not using trusted security. I do not want the login dialog brought up, I
want an error returned instead.

Please, please, please, this is not a request on how to save the user id and
password inside access when linking the table (I know how to do that) or a
request on how to first get the user id and password from the user. Nor am I
looking for a suggestion to instead use trusted security.

This is a request on how, when opening the recordset, under NO circumstances
do I want a login dialog box to appear.

The reason is because the program I am writing is to be deployed as a
Windows service on a server. It is performing requests on behalf of clients
runnnig on remote machine, so if there is a setup problem such as the linked
table does not have a correct user id or password a login dialog box on the
server will not be seen by the client. If an error is returned from the
OpenRecordset, I can then pass the error information back to the client
telling them they have a setup problem.
 
thanks,
--george
(gbierNO_SPAM)@fs.com (remove the NO_SPAM if replying)
  
  



Relevant Pages

  • Re: Access link table security
    ... onerous chore of creating DSN's on each client. ... >and SQL Server is on the same machine. ... >How and where do I set at the Access frontend so that I can choose the login ... >change the login name for the Access frontend, do I need to play with ODBC ...
    (microsoft.public.sqlserver.security)
  • Re: SA Login
    ... Boris, ... Suppose that the client wants to apply the latest security patch to the ... SQL Server instance. ... Without any way to login as a member of the SysAdmin ...
    (microsoft.public.sqlserver.security)
  • Re: Unexpected Login Screen When Accessing SQL Data Via .NET Intra
    ... >> data and the SQL Server is on the same server. ... >> My problem is that one user has started getting a login popup ... >> right in via Windows Authentication like everyone else and like they ...
    (microsoft.public.sqlserver.connect)
  • Re: cannot acees two databases as owner
    ... it does not matter you are a member of the ... the sysadmin fixed server role or if there is no any other Login which is ... group if it's a domain) and you can login to your SQL Server with, ...
    (microsoft.public.sqlserver.setup)
  • Re: Connection Pooling nastiness
    ... command.timeout, request 2 receiving request 1's result, and finally request ... So basically that's blown a whole in my theory of blaming Connection ... Now the only suspect would suddenly seem to be Sql Server. ... client A gets an ADO.Net/SqlClient connection from the connection pool ...
    (microsoft.public.dotnet.framework.adonet)