Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

sacsac (Programmer) (OP)
7 Nov 11 11:43
I have a VB2010/.NET4 program using ADO to connect to a Jet database, both reading and writing to it.  It works just fine in the development environment, but when deploying on other machines it errors with the following:

************** Exception Text **************
System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'ADODB.Connection'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00001550-0000-0010-8000-00AA006D2EA4}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).


Is there some resource file which I should be including with the distribution?  
     
jebenson (TechnicalUser)
8 Nov 11 11:44

There are different things that could cause this error, and different fixes.

1) If you are accessing database fields like this:

        <recordset>("FieldName")

change it to:

        <recordset>("FieldName").Value


2) If you are setting up your ADODB.Connection like this:

        Dim cnn As ADODB.Connection
        cnn = CreateObject("ADODB.Connection")

change it to this:

        Dim cnn As ADODB.Connection
        cnn = New ADODB.Connection()

3) You might need to install the latest version of the Micorsoft Data Access Components (MDAC) to the target PC.

4) You might need to install the Microsoft Access Runtime (AccessRuntime.exe) to the target PC.


All that said, I highly recommend rewriting your application to use ADO .NET to connect to your database, not the old ADODB.  You'll avoid a lot of these problems that way.

I used to rock and roll every night and party every day.  Then it was every other day.  Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys!  Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!  

sacsac (Programmer) (OP)
9 Nov 11 4:39
Thanks for your thoughts jebenson.  I am using the syntax you give for creating the connection, however I am now currently downloading the AccessRuntime and MDAC to see if that works on the deployment PCs.  The strange about this is that a few months back I distributed an application using ADODB and it runs perfectly all all machines.  If I now recompile it it errors!  I therefore think that there must be some change to my development environment causing the problem.  ANyway, thanks again and I'll let you know the outcome of your recommendations.
sacsac (Programmer) (OP)
9 Nov 11 5:32
Installed the AccessRuntime on XP SP3 machine to test, with negative result.  Then tried installing MDAC, and it reports that all the MDAC functionality is contained within operating system. Completely stuck now!
sacsac (Programmer) (OP)
11 Nov 11 20:23
Eventually I h have found the cause of the problem - the Windows 7 SP1.  See "http://support.microsoft.com/kb/2517589"
Once I followed the solution outlined in this article everything was resolved.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close