Temporary Queries

wcboyd

Registered User.
Local time
Yesterday, 18:00
Joined
Aug 30, 2004
Messages
50
Hello All,

I am doing a lot of temporary queries like this:
Code:
Set PTQuery = db_Oracle.CreateQueryDef("qryTemp")
I am deleting them w/n the same block of code when I am done with them.
Code:
CurrentDb.QueryDefs.Delete "qryTemp"

Sometimes the queries overlap so I have taken to appending a number on the end. Thus, qryTemp01, 02, 03, etc..

I am using these for pass-through queries as they perform much better than the ODBC connection to my Oracle DB.

Is this the best way to do this or is there another way that is better?
 
Was this a glitch, or on purpose?
I'll bet you that he was having trouble like I was with the site not seeming to do anything. I would gather we may have several duplicate/triplicate posts here soon as the website seemed to "lock" up and just sit there for quite some time. Someone hits the button and then it just sits there so they stop and hit it again not knowing that it already posted.
 
In fact I just had one of those triple posts in a thread of mine as someone posted a response. :)
 
I guess so. I just saw a quadruple. :eek:
 
I guess so. I just saw a quadruple. :eek:

I learned about that behavior a long time ago and so now if my post doesn't appear to go through, I open another browser window to that thread and look. 9 times out of 10 it is posted even though it is still just sitting there looking like it hasn't over in the other browser window. I then just close the browser. But that isn't something that is

1. easy to teach

2. really possible to teach effectively to most posters.

So, we just have to live with it and maybe have a mod/admin clean up after it :D
 
A glitch! The my browser kept timing out while I was submitting it so I kept trying until it went through. I won't do that next time. Sorry about the inconvenience.
 
OK...now that has been cleared up. I create/delete my temporary queries for each even because that is what the example I found did.
Should I not be doing that?
Should I instead be creating a global temporary query and then leave it open until the application closes and just keep changing the SQL and re-running?
 
Somebody deleted the thread that I originally answered on. I wouldn't keep creating and deleting objects, no. Presuming the reason you're doing that is to change criteria or something, I use a DAO QueryDef to change the SQL of a saved passthrough query that a report or form is based on.
 

Users who are viewing this thread

Back
Top Bottom