Hi Guys,
I am having a problem with a late binding conversion with ADO. I have
the following sub which is designed to be passed an ADO connection
object and also the full path to the .mdb file, then if the file
actually exists attempt a connection to it.
Sub ConnectMDB(ByRef connector As Object, ByVal filename As String)
Set connector = Nothing
Set connector = CreateObject("ADODB.Connection")
If FileExists(filename) Then
'Set connector = New ADODB.Connection
With connector
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source = " & filename & ";"
.Mode = adModeShareExclusive
.Open
End With
End If
End Sub
There seems to be an issue with the adModeShareExclusive. When I try
and use the code I am receiving a 'Variable not defined' on the mode
setting (it is highlighted) and the execution stops on the first line
of the sub. It works fine when the reference exists, but not without
it seems.
Any ideas?
The Frog