Re: Access Pass through Query Executes Multiple Times

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Mary Chipman (mchip_at_online.microsoft.com)
Date: 04/26/04


Date: Mon, 26 Apr 2004 08:56:29 -0400

Since you're using an unbound form, step through your code and then
look at the Profiler trace after each step. It's possible that this is
caused because you don't have SET NOCOUNT ON as the first line in your
stored procedure.

--Mary

On Sun, 25 Apr 2004 06:06:02 -0700, "Lance"
<anonymous@discussions.microsoft.com> wrote:

>Hi,
>
>I am using MSACCESS 2002 with SQL Server 2000. I have an unbound form when it opens I assign a pass through query to the rowsource of a combo box. The pass through query calls a stored procedure. On my form unload event I set the rowsource to empty. When I load the form I am only assigning the query once, however, it is appearing in profiler as many as three times within milliseconds of each other.
>
>Can someone tell me if the query is actually executing three times or is this some anomoly of profiler that is causing it to appear this way. I have included the results of the trace below.
>
>Thanks
>
>1.
> EVENT CLASS TEXT DATA APPLICATION nAME LOGIN NAME
>--------------------------------------------------------------------------------------------------------------------------------------
>SQL:BatchCompleted exec setEECboRS '4/23/2004','4/29/2004' Microsoft Office XP Scheduler 15
> READS WRITES CPU DURATION CLIENT PROCESS ID START TIME
>-------------------------------------------------------------------------------------------------------------
> 633 0 16 5712 57 2004-04-24 23:45:05.953
>2.
> EVENT CLASS TEXT DATA APPLICATION nAME LOGIN NAME
>--------------------------------------------------------------------------------------------------------------------------------------
>SQL:BatchCompleted exec setEECboRS '4/23/2004','4/29/2004' Microsoft Office XP Scheduler 16
> READS WRITES CPU DURATION CLIENT PROCESS ID START TIME
>-------------------------------------------------------------------------------------------------------------
> 633 0 13 5712 57 2004-04-24 23:45:05.970
>3.
> EVENT CLASS TEXT DATA APPLICATION nAME LOGIN NAME
>--------------------------------------------------------------------------------------------------------------------------------------
>SQL:BatchCompleted exec setEECboRS '4/23/2004','4/29/2004' Microsoft Office XP Scheduler 16
>
> READS WRITES CPU DURATION CLIENT PROCESS ID START TIME
>-------------------------------------------------------------------------------------------------------------
> 633 0 16 5712 57 2004-04-24 23:45:05.983