|
-
Feb 3rd, 2005, 07:35 AM
#1
Thread Starter
Fanatic Member
VBa Generated SQL for Access
I have a VBa App that creates this SQL:
UPDATE type INNER JOIN (select * from Mat_data in 'C:\sb-Data\sb\In Tray\New_18_1_2005.mdb') T1 ON type.SBKEY = T1.type_SBKEY SET Type.Name = [T1].[Type_name], Type.[Measure ID] = DLookup('[Measure ID]', '[Measure]', "'[Measure].[SBKey] = " & [T1].[Measure_SBKey] & "'"), Type.Wm_Ratio = dlookup("[id]", "[converter]","'[converter].[sbkey] = " & [t1].converter_sbkey & "'");
This SQL takes almost five and a half minuets to run with a smallish data sample. That is far to slow.
That's the challenge then a better way of asking for the same thing.
-
Feb 3rd, 2005, 10:28 AM
#2
Re: VBa Generated SQL for Access
If you replace * on select * from with all the column names of the table, you get a small speed advantage. It might be worth of nothing in this case, it is just a common trick used on forums to speed things up a little.
-
Feb 4th, 2005, 03:44 AM
#3
Re: VBa Generated SQL for Access
Don't use DLookup - its slow... very slow...
What are you trying to do?
EDIT:
Join the other two tables in if possible...
Sub queries?
Last edited by Ecniv; Feb 4th, 2005 at 10:39 AM.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|