DLookup problem

B

bill

I support an application which uses DLookup extensively in ADP code modules.

In the code, a DLookup statement executes, and then a stored procedure
executes a few lines later.

In the profile trace, I found to my surprise that frequently the stored
procedure actually completes BEFORE the DLookup statement, even though the
DLookup statement precedes it in the code.

This shouldn't be asynchronous, should it? Should not the code execution
wait for the DLookup to complete before proceeding?

This is sometimes a problem, because the action taken after the DLookup
statement is determined by the results of the DLookup statement.

I'm going to get rid of the DLookup statement and see if it is corrected,
but I wonder if this is a common occurrence, and what is the cause of it.

Thanks
Bill
 
J

J. Clay

I have found that the DLookup is very slow in ADPs. You are much better off
using an ADO recordset to get any info you want.

Complete speculation here, but my guess is that DLookup uses Jet DAO, and in
an ADP needs to be translated to ADO to talk to the SQL Server, thus causing
a significant performance hit. Whereas, ADO is native in an ADP thus there
is no performance hit.

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top