• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1515
  • Last Modified:

Error HRESULT E_FAIL has been returned from a call to a COM component.

What could cause Error HRESULT E_FAIL has been returned from a call to a COM component ? I have a user group of 40 connecting to a SQL server and some have never had this error and some get this error atleast once per week. :-/
0
Jakelee80
Asked:
Jakelee80
  • 5
  • 4
  • 2
2 Solutions
 
zadeveloperCommented:
please send the code which establishes the sql connection.
0
 
Jakelee80Author Commented:
So its the SQL communication that would cause this?
0
 
iUsernameCommented:
Do you have a stack trace of where this error occurs?
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
zadeveloperCommented:
No. May be the objects u are using if not using standard ado .net
0
 
Jakelee80Author Commented:
This has been showing up on my catch exceptions then sent to my error report database, its random so will have to wait till someone gets this error again to see if I can get that.
0
 
Jakelee80Author Commented:
oh here is what im using

using System;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using Microsoft.Win32;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Timers;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
using System.Data.SqlClient;
using System.Net;
using System.Net.Sockets;
using System.Net.NetworkInformation;
using System.IO;
using System.Reflection;
using System.Text.RegularExpressions;
using Outlook = Microsoft.Office.Interop.Outlook;
using System.DirectoryServices;
using System.Windows;
using System.Xml;
using System.Diagnostics.PerformanceData;
using System.Drawing.Imaging;
0
 
zadeveloperCommented:
This stack has nothing to do with SQL. Please post the code in the try block
0
 
iUsernameCommented:
The stack has nothing to do with SQL, but it might tell you if it happens during connection, during execution of a stored procedure, or whatever.

E_FAIL is too generic, so you need to know which line of code is throwing the exception (== stack tace).
0
 
zadeveloperCommented:
Hi iusername.

Typeing on my phone made my statment unclear. I was saying that the comment posted does not help us.

As I asked before please could we have a copy of the line of code that causes the com exception. And also the creation of the object.
0
 
Jakelee80Author Commented:
Only issue with that is I have more then 100 try / catch's, this is a fairly large program. But after gathering enough examples its been resolved, had to do with a network resource going offline.
0
 
Jakelee80Author Commented:
I got a good idea of what i needed to look for.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 5
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now