Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2006, 09:26 PM
Registered User
 
Join Date: Mar 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Object Existing

In my Access application, a make table created executed and deleted when finished. At times runtime errors are displayed after the query has ran. How can I check for the query existance when the progrma runs?

 
Old April 12th, 2006, 12:30 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Put this code before your problem code if you know the code is running okay and the errors are erroneous:

'--------
On Error Resume Next

'--------

HTH

mmcdonal
 
Old April 12th, 2006, 12:34 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Sorry, I missed the last sentence. What do you mean you want to check for a query's existence?


mmcdonal
 
Old April 12th, 2006, 02:48 PM
Registered User
 
Join Date: Mar 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the response.

My code creates a query on the fly. When the user is finished the query is deleted. It is ok as long as runtime errors do not show. The problem happen recently when the application is used in Access 2000. A runtime error 2486 "Access is busy". I usually kill Access by going to Task Manager. When running the application after killing it, the application never had chance to delete the query. I have found some code to check for the query, but it bombed when the query didnot exist. Here is the code:

If curdb.QueryDefs("qryCreate Current Date").Name = "qryCreate Current Date" Then
    DoCmd.DeleteObject acQuery, "qryCreate Current Date"
End If

Note: The application was created in Access 2003, but used by Access 2000 users.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Existing Components Thami SQL Server 2005 0 August 8th, 2008 02:51 AM
Serializing object into existing XmlTextWriter planoie .NET Framework 2.0 0 October 15th, 2007 09:54 AM
Problem with an existing application davidrodrigues40 ASP.NET 2.0 Professional 2 March 22nd, 2007 10:13 AM
Checking for existing object Quick209 C# 1 February 14th, 2006 07:18 PM
Adding existing and non-existing attributes spencer.clark XSLT 5 July 27th, 2005 04:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.