Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. E_NOINTERFACE

E_NOINTERFACE

Scheduled Pinned Locked Moved C#
securityquestiondatabasecomhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Norman Fung
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups