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