G
Guest
(repost from feb 2 and feb 28. This time I am properly registered as an msdn
subscriber..., see if it helps)
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
running 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
subscriber..., see if it helps)
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
running 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