E_NOINTERFACE
-
This code works in a "console" app, but when I place it in a COM+ serviced component, I got "E_NOINTERFACE" exception when I called OleDbAdapter.Fill(..) public void AuthenticateUser(string username, string passwd, ref int retcode) { //AuthenticateUser int count = -1; string db_username; string db_passwd; int db_numlogin; string connString; OleDbConnection connUsers; OleDbDataAdapter daUsers; DataSet dsUsers; EventLog log = new EventLog("Application"); log.Source = "AccessDbMaster"; try { //try block retcode = -1; connString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Program Files\AppAlgo\ComPlusServiceDemo\datasource\users.mdb; User ID=Admin; Password="; connUsers = new OleDbConnection(connString); daUsers = new OleDbDataAdapter("SELECT * FROM Users WHERE username='"+ username + "' AND passwd='" + passwd + "'", connUsers); dsUsers = new DataSet(); daUsers.Fill(dsUsers, "Users"); count = dsUsers.Tables["Users"].Rows.Count; if(count==0) { log.WriteEntry("AccessDbMaster authentication failed. User not found"); return; } foreach(DataRow user in dsUsers.Tables["Users"].Rows) { db_username = user["username"].ToString(); db_passwd = user["passwd"].ToString(); db_numlogin = (int) user["numlogin"]; retcode = db_numlogin; //return value //Increment number of login: db_numlogin++; user["numlogin"]=db_numlogin; } OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(daUsers); daUsers.Update(dsUsers, "Users"); connUsers.Close(); } //try block catch(Exception err) { log.WriteEntry("AccessDbMaster authentication failed. Info: " + err.Message); retcode=-1; } return; } //AuthenticateUser Error message is not very descriptive: "No error information available: E_NOINTERFACE(0x80004002)." I'm suspecting that it's got to do with COM+ security. I checked identity using COM+ Admin Tool. The application, and all COM+ apps in question, runs under SYSTEM account (Administrators). Impersonation level is "Impersonate" and "Packet"... Any idea? Thanks!