Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can you show me how to use the CreateObject function in VB .NET applications?

0
10 Posted

Can you show me how to use the CreateObject function in VB .NET applications?

0
10

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123