doulostheou
Registered User.
- Local time
- Today, 07:30
- Joined
- Feb 8, 2002
- Messages
- 314
I was looking through some old posts to see if I could figure out where I am going wrong when I ran across this quote from you:
Stored querydefs are the most efficient way to use SQL. When the querydef is saved, Jet validates the code and creates the most efficient access plan for executing the query. This information is stored for use whenever the query is run. When you use SQL in code or as the recordsource for forms or reports, this calculation and optimization must be done each and every time the query is run.
I recall reading something very similar to this before and from what I understand your opinion is one to be valued. I was just wondering if this would apply to what I am trying to accomplish (described in the thread at the bottom of this post). I don't know much about querydefs, but in my code I am looping through 200 users and running an append and delete query for each. Is there anyway to write a dynamic querydef? Where the table would change each time the code ran the query (I imagine I would still have to loop it through code to change the variables). I have nearly got the code below working, but I ran into a dead end trying to detect if a table was null and I am not satisfied with the time efficiency of the procedure as a whole (albeit greatly improved from running it from a macro).
http://www.access-programmers.co.uk/ubb/Forum7/HTML/003455.html
Stored querydefs are the most efficient way to use SQL. When the querydef is saved, Jet validates the code and creates the most efficient access plan for executing the query. This information is stored for use whenever the query is run. When you use SQL in code or as the recordsource for forms or reports, this calculation and optimization must be done each and every time the query is run.
I recall reading something very similar to this before and from what I understand your opinion is one to be valued. I was just wondering if this would apply to what I am trying to accomplish (described in the thread at the bottom of this post). I don't know much about querydefs, but in my code I am looping through 200 users and running an append and delete query for each. Is there anyway to write a dynamic querydef? Where the table would change each time the code ran the query (I imagine I would still have to loop it through code to change the variables). I have nearly got the code below working, but I ran into a dead end trying to detect if a table was null and I am not satisfied with the time efficiency of the procedure as a whole (albeit greatly improved from running it from a macro).
http://www.access-programmers.co.uk/ubb/Forum7/HTML/003455.html