Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VSTO 2005 Access

Posted on 2006-11-13
4
Medium Priority
?
209 Views
Last Modified: 2010-04-23
Hi

I am trying to use the following code to manipulate Access from VSTO 2005 and am
getting the error "Type Access.Aplication is not defined"

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 
        ' instantiate Access
        Dim objAccess As Access.Application
        objAccess = New Access.ApplicationClass
 
        ' make Access visible to the user
        objAccess.Visible = True
 
        ' open the Northwind sample database
        objAccess.OpenCurrentDatabase(filepath:="C:\Program Files\Microsoft Office\Office11\Samples\Northwind.mdb")
 
        ' identify the report you want to display
        objAccess.DoCmd.SelectObject(ObjectName:="Sales by Category", InDatabaseWindow:=True, _
        ObjectType:=Access.AcObjectType.acReport)
 
        ' show the report
        objAccess.DoCmd.OpenReport(ReportName:="Sales by Category", _
                    View:=Access.AcView.acViewPreview)
 
        objAccess = Nothing
 
    End Sub
0
Comment
Question by:Murray Brown
  • 3
4 Comments
 
LVL 6

Expert Comment

by:riyazthad
ID: 17931783
You missed COM reference to Access.

Add a COM reference.

Thad
0
 

Author Comment

by:Murray Brown
ID: 17931797
I have done that
0
 
LVL 6

Expert Comment

by:riyazthad
ID: 17931858
Could you create an instance of object 'Access.Application'? Where you are getting error exactly?

0
 
LVL 6

Accepted Solution

by:
riyazthad earned 2000 total points
ID: 17931958
Import interop namespace then ....

Imports Microsoft.Office.Interop
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

810 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