Solved

vb.NET application using AccessDB to run MAKETABLE query wont work on other machine. errors dont make sense. Possibly Access version difference issue?

Posted on 2013-01-16
2
313 Views
Last Modified: 2013-04-03
I know my heading doensnt make much sense, but im quite lost as to what is happening!

i have the following code:

Sub UpdateStatusReport()


    Try
        Dim oAccess As Access.Application
        oAccess = New Access.Application()

        oAccess.OpenCurrentDatabase("I:\GPS_Conversion\XY_Convert2.mdb", True)
        oAccess.DoCmd.SetWarnings(WarningsOn:=False)
        oAccess.DoCmd.OpenQuery("A1qryMt_FindMaxStatusReportID")
        oAccess.DoCmd.OpenQuery("A2qryUpd_ReduceMaxStatusReportID")
        oAccess.DoCmd.OpenQuery("A3qryMt_StatusReport")
        oAccess.DoCmd.SetWarnings(WarningsOn:=True)
        System.Runtime.InteropServices.Marshal.ReleaseComObject(oAccess)
        oAccess = Nothing
        Console.WriteLine("updated table with live info")
    Catch ex As Exception
        Dim ex1 = ex.ToString
        My.Computer.FileSystem.WriteAllText("C:\logfile.txt", ex1, True)
    End Try

End Sub

Open in new window


I import the following:

Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.DataRowExtensions
Imports System.Data.SqlClient
Imports System.ComponentModel
Imports Microsoft.Office.Interop
Imports ADODB

Open in new window


the error i get from the above is:

System.Runtime.InteropServices.COMException (0x800A09C5): The OpenQuery action was canceled.
   at Microsoft.Office.Interop.Access.DoCmd.OpenQuery(Object QueryName, AcView View, AcOpenDataMode DataMode)
   at CurrentPositionHTMLCreate.Module1.UpdateStatusReport() in C:\IT3_New\Michael\CurrentPositionHTMLCreate\CurrentPositionHTMLCreate\Module1.vb:line 30System.Runtime.InteropServices.COMException (0x800A09C5): The OpenQuery action was canceled.
   at Microsoft.Office.Interop.Access.DoCmd.OpenQuery(Object QueryName, AcView View, AcOpenDataMode DataMode)
   at CurrentPositionHTMLCreate.Module1.UpdateStatusReport() in C:\IT3_New\Michael\CurrentPositionHTMLCreate\CurrentPositionHTMLCreate\Module1.vb:line 30System.Runtime.InteropServices.COMException (0x800A09C5): The OpenQuery action was canceled.
   at Microsoft.Office.Interop.Access.DoCmd.OpenQuery(Object QueryName, AcView View, AcOpenDataMode DataMode)
   at CurrentPositionHTMLCreate.Module1.UpdateStatusReport()System.Runtime.InteropServices.COMException (0x800A09C5): The OpenQuery action was canceled.
   at Microsoft.Office.Interop.Access.DoCmd.OpenQuery(Object QueryName, AcView View, AcOpenDataMode DataMode)
   at CurrentPositionHTMLCreate.Module1.UpdateStatusReport()System.Runtime.InteropServices.COMException (0x800A09C5): The OpenQuery action was canceled.
   at Microsoft.Office.Interop.Access.DoCmd.OpenQuery(Object QueryName, AcView View, AcOpenDataMode DataMode)
   at CurrentPositionHTMLCreate.Module1.UpdateStatusReport()

Open in new window


Its a small sub that calls a series of MAKETABLE queries in access.

On the computer that i wrote the program on it works fine, but when i use any other computer i get all sorts of issues. Ive narrowed it down by slowly breaking apart the code until i found what didn't work, from the whole application.

basically this updates a table in the DB from a DBO that is on a slq server. I cant get direct access to that server, i can only access it via the accessDB with these queries in it.

basically, ive come to the conclusion that its a version issue? it looks like i have office 2007 on this machine, and most other machines ive tried it on has 2000 or 2003. but i installed "Microsoft Access Database Engine 2010 Redistributable" on those machines thinking that it might be the issue, but it hasnt resolved my problem.

is there another way i can do this? is there some backward compatible code i can write that might make it workable in older versions of access? Im not really sure what im looking for here, but i need a way to be able to get the live data from the DBO's and update it into the database that i use for this application.

thanks,

Mike
0
Comment
Question by:AER
2 Comments
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 250 total points
ID: 38786152
Have you installed the Office Interop and ADODB on the machine?
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 38798157
I don't use Office Interops much, but I believe you must have the correct "version" of that interop to use with different versions of Office (at least for the newer versions of 2007 and 2010). 2007/2010 use the new ACE format for databases, whereas earlier versions use JET.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now