Howard Kaikow
04-29-2005, 05:48 AM
The code below, or equivalent, works in Access 2000, Access 2002 and Access 2003, but not in Access 97.
A Reference to the VBA for Extensibility library is included.
Is there a fix?
Option Compare Database
Option Explicit
Private Sub test()
Const strProject As String = "HKNewProject"
Dim appAccess As Access.Application
Dim strPath As String
strPath = strProject & ".mdb"
If Len(Dir(strPath)) <> 0 Then
On Error Resume Next
Kill strPath
On Error GoTo 0
End If
Set appAccess = New Access.Application
With appAccess
.NewCurrentDatabase strPath
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' The following does not compile in Access 97
Debug.Print .VBE.VBProjects.Count
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
.Quit
End With
Set appAccess = Nothing
End Sub
A Reference to the VBA for Extensibility library is included.
Is there a fix?
Option Compare Database
Option Explicit
Private Sub test()
Const strProject As String = "HKNewProject"
Dim appAccess As Access.Application
Dim strPath As String
strPath = strProject & ".mdb"
If Len(Dir(strPath)) <> 0 Then
On Error Resume Next
Kill strPath
On Error GoTo 0
End If
Set appAccess = New Access.Application
With appAccess
.NewCurrentDatabase strPath
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' The following does not compile in Access 97
Debug.Print .VBE.VBProjects.Count
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
.Quit
End With
Set appAccess = Nothing
End Sub