473,385 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Automated MSAccess from VB.NET hang on error?

I have a vb.net application that calls a sub in MSAccess. I have
loaded the office interops and everything works fine if there are no
errors. If the sub in Access produces an Error then my application
hangs and goes no further.

In the example I am testing with I get and ODBC error because I am
passing to many parameters to a stored procedure(on purpose)

How can I get the error back?

[code]
Dim objAccess As New Access.Application()
Try
.....
' OPEN THE NEW COPY OF THE MDB
objAccess.OpenCurrentDatabase(strMDBPath)
' RUN THE FUNCTION FROM ACCESS TO CREATE THE REPORT SNAPSHOT
objAccess.Run("RunReports", pReportName, vSQLText, pOutputFileDir,
strSNPName, pConnectString)

' SHUT DOWN ACCESS AND RELEASE THE COPY FROM MEMORY
objAccess.DoCmd.Close(Access.AcObjectType.acDefaul t, strMDBName)
objAccess.DoCmd.Quit(Access.AcQuitOption.acQuitSav eNone)

Catch errorVariable As Exception
' ERROR HANDLING
......
Finally
System.Runtime.InteropServices.Marshal.ReleaseComO bject(objAccess)
End Try
Thanks
Nov 20 '05 #1
0 998

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Chris | last post by:
We are currently using the following code to execute an automated mail merge in Windows 2000: Set AwordObj = New Word.Document Set AwordObj = AwordObj.Application.Documents.Add(file_path)...
3
by: Brad Burke | last post by:
From a windows .Net app, I need to 1) check if MSAccess is already open to a certain Access application. If so, then open a form and find a certain record. 2) If not open, then open MSAccess and...
15
by: (Pete Cresswell) | last post by:
I've got a .BAT file that I use for executing various MS Access apps that I wrote way back in the days of 2.0. It's evolved over time, but it still contains a number of possible paths to...
0
by: Richard Beacroft | last post by:
Trying to write a C# Windows App to export all objects and content from 2 MSAccess 97 databases for comparison analysis. very little documentation found. Have managed to instantiate MSAccess,...
5
by: murrayatuptowngallery | last post by:
I'm caught in a classic finger-pointing situation. My hosting company's server appears to be automatically inserting JS tags into a JS-free html page that has an image inked to a 2nd page with...
1
by: NUKhan | last post by:
Hello Friends I uninstalled a trial program that also removed some shared files of MSACCESS. My program in VB6 with MSACCESS database stopped working. When I open a database table in MSACCESS, it...
0
by: Jordan S. | last post by:
Okay so I've finally "seen the Light" about writing automated unit tests ahead of time. Question: What is a very simple approach that I can use to setting up automated unit tests, considering...
0
by: bbrewder | last post by:
I am struggling with some MSAccess automation issues. Basically, we have a .Net application that uses MSAccess for reporting (legacy code). We are able to launch MSAccess fine and even work with...
9
by: jdaelhousen | last post by:
I have a bit of a problem I'm hoping someone can shed some light on... I have a VB.Net console application written in VS 2003 that produces a .exe file that now sits on a Windows 2000 server...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.