Can you show me how to use the CreateObject function in VB .NET applications?
In VBA code one can have code as follows: Dim objAcObj As Object Dim appAccess As Object Set appAccess = CreateObject(“Access.Application”) appAccess.OpenCurrentDatabase (“c:\northwind.mdb”) … … appAccess.Quit Set appAccess = Nothing In VB .NET code one needs to change them to: Imports Access … … Dim objAcObj As AccessObject, appAccess As New Access.Application appAccess.OpenCurrentDatabase(“c:\northwind.mdb”) … … appAccess.CloseCurrentDatabase() appAccess.Quit(2) ‘Microsoft.Office.Interop.Access.Constants.acExit appAccess = Nothing Note: add Microsoft Access Object Library as a COM reference to the VB .NET project.
Related Questions
- I require training on College systems and applications to function in my position efficiently, where can I register or arrange for training?
- How can applications be added and/or deleted from a subscription? Is this function available using the administrative tool?
- Can VB Migration Partner convert MTS/COM+ applications?