Running an Access module from VB

Running an Access module from VB

Post by Lorett » Wed, 07 Feb 2001 03:59:14



Is it possible to run a MS Access module from VB without having Access on the
computer. The only ways I have been able to get it to work (using MSACC9.olb), I
still see an MSAccess.exe process running.
 
 
 

Running an Access module from VB

Post by Douglas J. Steel » Wed, 07 Feb 2001 08:18:40


No, there isn't. Having the royalty-free Access runtime (available as part
of the Office Developer's edition) is sufficient, though.

--

Doug Steele, Microsoft Access MVP
Beer, Wine and Database Programming. What could be better?
Visit "Doug Steele's Beer and Programming Emporium"
http://I.Am/DougSteele/


Is it possible to run a MS Access module from VB without having Access on
the
computer. The only ways I have been able to get it to work (using
MSACC9.olb), I
still see an MSAccess.exe process running.

 
 
 

1. Running MS Access Module from VB

Hi,

I am trying to make a VB program to communicate via Automation with an
Access Module, but I am getting the errors I am indicatin to you.

The DoCmd. method called from VB(5) does not support the DoCmd.Run(Code)
method. How could you solve this kind of prob?

I have a

Any help would be appreciated

Thank you
Camilo
-------------------------------------------------------------------------
'Access Module
Option Compare Database
Option Explicit

Function Module1(sByAccess As String)

 On Error GoTo Module1_Err
 MsgBox " Here by Access now" & sByAccess

Module1_Exit:
    Exit Function
Module1_Err:
    MsgBox Error$
    Resume Module1_Exit

End Function

-------------------------------------------------------------------------
'VB5 code
Private Sub RunModule_Click()
 Dim objAccessApp As Object
 Dim sDBName As String
 Dim sAcMdlName As String

 On Error GoTo AutmtnError

 sAcMdlName = "Module1"
 sDBName = "E:\PRJCTS\AccessApp\DBModule.mdb"
 Dim AcMdl As Access.Module

 Set objAccessApp = CreateObject("Access.Application")
 With objAccessApp
  .OpenCurrentDatabase FilePath:=sDBName
MsgBox " Data base should be opened" & sDBName
  .DoCmd.OpenModule sAcMdlName
  Set AcMdl = .Modules(sAcMdlName)
MsgBox " Module " & AcMdl.Name & " should be open"

''''''' This is what it does not work '''''''''

'  AcMdl.Application.Run sAcMdlName, " Hi from VB"
'  AcMdl.Application.Run sAcMdlName   '<- tried this one also with Mudule
without args


' ... MS Access Number: 2517

'''''''''''''''''''''''''''''''''''''''''

MsgBox " Module about to be closed"

  .DoCmd.Close acModule, AcMdl.Name, acSaveNo

MsgBox " Data base about to be closed"

  .CloseCurrentDatabase
 End With

 DoEvents
 Set objAccessApp = Nothing

 Unload Me
 Exit Sub
AutmtnError:
 MsgBox Err.Description & " from " & Err.Source & " Number: " &
CStr(Err.Number)

End Sub

2. recherche d un livre sur oracle pour debutants

3. How to run an Access module from VB using ADOX/ADODB?

4. OK, here's an easier one

5. VB Module from DTS how do I run in VB

6. ACCESS 2000 SQL FORM PROBLEM WITH VBA.

7. Accessing an MS-Access module from VB code

8. Changing a userid and password

9. ACCESS run-time module

10. calling/running MS Access module from ASP pages

11. To run access module in VBasic

12. run access module from excel sub

13. How to run an Access module?