On Wed, 2 Mar 2005 16:30:03 -0600, "moondaddy" <mo*******@nospam.com> wrote:
¤ I'm trying to use similar code as you used below, however, as mentioned in
¤ the link you provided, the PIAs are not to be used in the application setup
¤ process. If I don't include them in the setup then this code wont run on
¤ the client. If I do include them in the setup, the code will run on the
¤ client, but 1) the msdn documentation says we don't have the right to
¤ distribute these, and 2) by installing these on the client we could corrupt
¤ the office registration on the client when they do an un-install of our
¤ applications. I was confused by the documentation in the URL as it didn't
¤ clarify how to distribute the .net app and have the client be able to use
¤ the code you listed below.
¤
¤ Do you have any advise on how to go about this?
¤
¤ Here's me code which is similar to your code:
¤
¤
¤ Public Function OpenApp() As FileMngr
¤ Try
¤ Dim sFile As String = "some path to ms access"
¤
¤ Dim sCrit As New StringBuilder
¤ Dim dr As wsMain.dsUser.tbCtlRow
¤ sCrit = "some stuff for access to use"
¤ 'Startup Access Now
¤ Dim AccessApplication As New Access.Application
¤ 'Make it visible ?should we do this later?
¤ If Not AccessApplication.Visible = True Then
¤ AccessApplication.Visible = True
¤ End If
¤ 'Open app
¤ AccessApplication.OpenCurrentDatabase(sFile)
¤ 'Call a function to start things running and pass in the user rights
¤ that will be used to initalize everything
¤ AccessApplication.Run("Main", sCrit.ToString)
¤ Return FileMngr.Success
¤
¤ Catch ex As Exception
¤ ErrLog(ex)
¤ End Try
¤ End Function
¤
¤
¤ The msdn documentaion said to set the property (Copy Local) on the reference
¤ to access to "False". When I did that, I get the following error:
¤
¤
¤
¤ System.IO.FileNotFoundException: File or assembly name Interop.Access, or
¤ one of its dependencies, was not found.
¤ File name: "Interop.Access"
¤ at TransAct.ClientAppHelper.OpenApp()
¤ at TransAct.frmMain.OpenClientApp() in
¤ D:\nwis\Apps\LandMan\VS\TransAct\TransAct\frmMain. vb:line 553
¤
¤ === Pre-bind state information ===
¤ LOG: DisplayName = Interop.Access, Version=9.0.0.0, Culture=neutral,
¤ PublicKeyToken=null
¤ (Fully-specified)
¤ LOG: Appbase = D:\nwis\Apps\LandMan\VS\TransAct\TransAct\bin\
¤ LOG: Initial PrivatePath = NULL
¤ Calling assembly : TransAct, Version=1.0.1887.28847, Culture=neutral,
¤ PublicKeyToken=null.
¤ ===
¤
¤ LOG: Policy not being applied to reference at this time (private, custom,
¤ partial, or location-based assembly bind).
¤ LOG: Post-policy reference: Interop.Access, Version=9.0.0.0,
¤ Culture=neutral, PublicKeyToken=null
¤ LOG: Attempting download of new URL
¤ file:///D:/nwis/Apps/LandMan/VS/TransAct/TransAct/bin/Interop.Access.DLL.
¤ LOG: Attempting download of new URL
¤ file:///D:/nwis/Apps/LandMan/VS/TransAct/TransAct/bin/Interop.Access/Interop.Access.DLL.
¤ LOG: Attempting download of new URL
¤ file:///D:/nwis/Apps/LandMan/VS/TransAct/TransAct/bin/Interop.Access.EXE.
¤ LOG: Attempting download of new URL
¤ file:///D:/nwis/Apps/LandMan/VS/TransAct/TransAct/bin/Interop.Access/Interop.Access.EXE.
¤ </Exception>
¤ </Errors>
¤ <Errors d2p1:id="2" d2p1:TimeStamp="2005-03-02T16:10:40.6916071-06:00"
¤ xmlns:d2p1="http://tempuri.org/dsErrorHandler.xsd">
¤ <Exception>System.IO.FileNotFoundException: File or assembly name
¤ Interop.Access, or one of its dependencies, was not found.
¤ File name: "Interop.Access"
¤ at TransAct.ClientAppHelper.OpenApp()
¤ at TransAct.frmMain.OpenClientApp() in
¤ D:\nwis\Apps\LandMan\VS\TransAct\TransAct\frmMain. vb:line 553
¤
¤ === Pre-bind state information ===
¤ LOG: DisplayName = Interop.Access, Version=9.0.0.0, Culture=neutral,
¤ PublicKeyToken=null
¤ (Fully-specified)
¤ LOG: Appbase = D:\nwis\Apps\LandMan\VS\TransAct\TransAct\bin\
¤ LOG: Initial PrivatePath = NULL
¤ Calling assembly : TransAct, Version=1.0.1887.28847, Culture=neutral,
¤ PublicKeyToken=null.
¤ ===
¤
¤ LOG: Policy not being applied to reference at this time (private, custom,
¤ partial, or location-based assembly bind).
¤ LOG: Post-policy reference: Interop.Access, Version=9.0.0.0,
¤ Culture=neutral, PublicKeyToken=null
¤ LOG: Attempting download of new URL
¤ file:///D:/nwis/Apps/LandMan/VS/TransAct/TransAct/bin/Interop.Access.DLL.
¤ LOG: Attempting download of new URL
¤ file:///D:/nwis/Apps/LandMan/VS/TransAct/TransAct/bin/Interop.Access/Interop.Access.DLL.
¤ LOG: Attempting download of new URL
¤ file:///D:/nwis/Apps/LandMan/VS/TransAct/TransAct/bin/Interop.Access.EXE.
¤ LOG: Attempting download of new URL
¤ file:///D:/nwis/Apps/LandMan/VS/TransAct/TransAct/bin/Interop.Access/Interop.Access.EXE.
¤
¤
¤
¤ Thanks for any help anyone can offer.
The references above are not to the Office PIAs but to the generic interop assemblies that are
created at design-time by the Visual Studio .NET IDE when you add one of the Office applications to
your project.
You should be able to deploy those interop assemblies with your app.
Paul ~~~
pc******@ameritech.net
Microsoft MVP (Visual Basic)