i have the following code and in the line no 19 i am getting runtime error 3734
" the database is locked by user name......canno t be opened or saved"
can someone tell me what am i doing wrong
" the database is locked by user name......canno t be opened or saved"
Code:
Sub plausibilitaet_check()
Dim rs As DAO.Recordset
Dim rs2 As ADODB.Recordset
Dim db As database
Dim strsql As String
Dim tdf As TableDef
Set db = opendatabase("C:\Codebook.mdb")
Set rs = db.OpenRecordset("plausibilitaeten")
Set rs2 = CreateObject("ADODB.Recordset")
rs2.ActiveConnection = CurrentProject.Connection
For Each tdf In CurrentDb.TableDefs
If Left(tdf.Name, 4) <> "MSys" Then
rs.MoveFirst
strsql = "SELECT * From [" & tdf.Name & "] WHERE "
Do While Not rs.EOF
On Error Resume Next
Debug.Print tdf.Name
rs2.Open strsql & " " & rs![plausibilitaet_alt]
If Err.Number = 0 Then
On Error GoTo 0
If Not rs2.EOF Then
Debug.Print rs![Error]
Debug.Print rs2.GetString
End If
End If
Err.Clear
rs2.Close
rs.MoveNext
Loop
End If
Next
End Sub
can someone tell me what am i doing wrong
Comment