By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,122 Members | 927 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,122 IT Pros & Developers. It's quick & easy.

Help required to unravel databases engine related Error Message

P: n/a
Hello,

In my application, I need to create temporary files, use them as
sources for queries which in turn populate forms. When a button is
clicked, I need to delete these temporary files, re-generate the
queries and refresh the forms.

I am encountering the following error which I am unable to unravel:

"The database engine could not lock table tbltempTDW because it is
already in use by another person or process."

Could someone guide me where to look for as to who or what process is
locking this up? I am somewhat familiar with the use of the debugger.

For some more info on how the table is created:

I use the following syntax for initial deletion of any old file with
the same name

Dim cat As ADOX.Catalog
Set cat = New ADOX.Catalog
cat.ActiveConnection = CurrentProject.Connection
cat.Tables.Refresh

cat.Tables.Delete "tbltempTDW"

the error message is displayed when I try to execute the
cat.Tables.Delete "tbltemTDW" statement.

Thanks in advance.

Uttam
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I use a function similar to this

Function DeleteTempQuery(QName As String) As Boolean

Dim MyDb As Database
Dim i As Integer

Set MyDb = CurrentDb
For i = 0 To MyDb.QueryDefs.Count - 1
If MyDb.QueryDefs(i).Name = QName Then ' Delete the Temp
Query
If IsQueryLoaded(QName) Then DoCmd.Close acQuery, QName
DoCmd.DeleteObject acQuery, MyDb.QueryDefs(i).Name
DeleteTempQuery = True
MyDb.Close
Set MyDb = Nothing
Exit Function
End If
Next i
DeleteTempQuery = False
MyDb.Close
Set MyDb = Nothing

End Function

Don't know if this is any help, but it's simple (Has to be for me)
Phil
"Uttam" <u0***@usa.net> wrote in message
news:8a**************************@posting.google.c om...
Hello,

In my application, I need to create temporary files, use them as
sources for queries which in turn populate forms. When a button is
clicked, I need to delete these temporary files, re-generate the
queries and refresh the forms.

I am encountering the following error which I am unable to unravel:

"The database engine could not lock table tbltempTDW because it is
already in use by another person or process."

Could someone guide me where to look for as to who or what process is
locking this up? I am somewhat familiar with the use of the debugger.

For some more info on how the table is created:

I use the following syntax for initial deletion of any old file with
the same name

Dim cat As ADOX.Catalog
Set cat = New ADOX.Catalog
cat.ActiveConnection = CurrentProject.Connection
cat.Tables.Refresh

cat.Tables.Delete "tbltempTDW"

the error message is displayed when I try to execute the
cat.Tables.Delete "tbltemTDW" statement.

Thanks in advance.

Uttam

Nov 12 '05 #2

P: n/a
hello Phil,

Could you please post the function "IsQueryLoaded" also? I get an
error for the function.

Thanks

Uttam

==========
"Phil Stanton" <ph**@stantonfamily.co.uk> wrote in message news:<3f***********************@mercury.nildram.ne t>...
I use a function similar to this

Function DeleteTempQuery(QName As String) As Boolean

Dim MyDb As Database
Dim i As Integer

Set MyDb = CurrentDb
For i = 0 To MyDb.QueryDefs.Count - 1
If MyDb.QueryDefs(i).Name = QName Then ' Delete the Temp
Query
If IsQueryLoaded(QName) Then DoCmd.Close acQuery, QName
DoCmd.DeleteObject acQuery, MyDb.QueryDefs(i).Name
DeleteTempQuery = True
MyDb.Close
Set MyDb = Nothing
Exit Function
End If
Next i
DeleteTempQuery = False
MyDb.Close
Set MyDb = Nothing

End Function

Don't know if this is any help, but it's simple (Has to be for me)
Phil
"Uttam" <u0***@usa.net> wrote in message
news:8a**************************@posting.google.c om...
Hello,

In my application, I need to create temporary files, use them as
sources for queries which in turn populate forms. When a button is
clicked, I need to delete these temporary files, re-generate the
queries and refresh the forms.

I am encountering the following error which I am unable to unravel:

"The database engine could not lock table tbltempTDW because it is
already in use by another person or process."

Could someone guide me where to look for as to who or what process is
locking this up? I am somewhat familiar with the use of the debugger.

For some more info on how the table is created:

I use the following syntax for initial deletion of any old file with
the same name

Dim cat As ADOX.Catalog
Set cat = New ADOX.Catalog
cat.ActiveConnection = CurrentProject.Connection
cat.Tables.Refresh

cat.Tables.Delete "tbltempTDW"

the error message is displayed when I try to execute the
cat.Tables.Delete "tbltemTDW" statement.

Thanks in advance.

Uttam

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.