468,747 Members | 1,655 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,747 developers. It's quick & easy.

Help required to unravel databases engine related Error Message

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
2 2693
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
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.

Similar topics

19 posts views Thread by Thue Tuxen Sørensen | last post: by
17 posts views Thread by the other john | last post: by
3 posts views Thread by Deasun | last post: by
3 posts views Thread by Adriano | last post: by
32 posts views Thread by robert d via AccessMonster.com | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.