firefly2k8
Registered User.
- Local time
- Yesterday, 21:48
- Joined
- Nov 18, 2010
- Messages
- 48
.. that prevents it from being opened or locked.
There seem to be more comprehensive posts on this error, but they focus on multiple users accessing the database. I am developing a new database. I have the code below, which works once. But run it a second time and I get this error and have to re-open access to clear it. Obviously this is a real pain when trying to develop something. Am i doing something wrong, how can i run this procedure again and again without closing access?
There seem to be more comprehensive posts on this error, but they focus on multiple users accessing the database. I am developing a new database. I have the code below, which works once. But run it a second time and I get this error and have to re-open access to clear it. Obviously this is a real pain when trying to develop something. Am i doing something wrong, how can i run this procedure again and again without closing access?
Code:
Sub test3()
Dim strSQL As String
Dim rst1 As ADODB.Recordset
Dim fld1 As Field
Dim int1 As Integer
strSQL = "SELECT DISTINCT [String1] & [Date1] AS Expr1 " & _
"FROM [Project Table 1] " & _
"WHERE [String1] is not null;"
Set rst1 = New ADODB.Recordset
rst1.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= FILEPATH;"
rst1.Open strSQL
With rst1
Do While Not .EOF
Debug.Print .Fields(0)
.MoveNext
Loop
End With
rst1.Close
Set rst1 = Nothing
End Sub