Sunday, February 19, 2012

Access Pass through Query Executes Multiple Times

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. Th
e pass through query calls a stored procedure. On my form unload event I se
t the rowsource to empty.
When I load the form I am only assigning the query once, however, it is appe
aring 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 thi
s some anomoly of profiler that is causing it to appear this way. I have in
cluded 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.983Since 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 open
s 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 empt
y.
When I load the form I am only assigning the query once, however, it is appearing in profile
r as many as three times within milliseconds of each other.
>Can someone tell me if the query is actually executing three times or is th
is some anomoly of profiler that is causing it to appear this way. I have i
ncluded 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 STAR
T 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 STAR
T 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 STAR
T TIME
>----
--
> 633 0 16 5712 57 2004-04-24 23:45:05.983|||Mary,
I did not have set nocount on but adding it did not affect the results in pr
ofiler. The profiler results I posted all have the same processID but one h
as a CPU value of 13 while the other two lines have a CPU value of 16. The
computer I am using has an
intel pentium 4 hyperthreading cpu that appears as two CPU to my operating s
ystem. This may be what is causing the results to appear multiple times eve
n though the stored procedure is only executed once. Can you confirm by loo
king at the output I posted
?
Thanks,
Lance|||That I couldn't tell you -- can you test from a different machine?
--mary
On Wed, 28 Apr 2004 10:10:58 -0700, "Lance"
<anonymous@.discussions.microsoft.com> wrote:

>I did not have set nocount on but adding it did not affect the results in profiler.
The profiler results I posted all have the same processID but one has a CPU value
of 13 while the other two lines have a CPU value of 16. The computer I am using has
an
intel pentium 4 hyperthreading cpu that appears as two CPU to my operating s
ystem. This may be what is causing the results to appear multiple times eve
n though the stored procedure is only executed once. Can you confirm by loo
king at the output I poste
d?|||Mary,
I can not move it to another machine at this time but will eventually (well,
I could but don't want to for this as I don't have the time and it can wait
). By the way, I do have a book that you co-wrote and found it a very good
reference.
Lance|||My form calls a pass-through query in my Access 2000/SQL Server App, and it
actually executes the stored procedure 3 times. This is very annoying.
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine sup
ports Post Alerts, Ratings, and Searching.|||Open a Profiler trace and step through your form code that calls the
stored procedure to pinpoint why it's getting called 3 times.
--Mary
On Tue, 29 Jun 2004 13:33:46 -0700, SqlJunkies User
<User@.-NOSPAM-SqlJunkies.com> wrote:

>My form calls a pass-through query in my Access 2000/SQL Server App, and it
actually executes the stored procedure 3 times. This is very annoying.
>--
>Posted using Wimdows.net NntpNews Component -
>Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports P
ost Alerts, Ratings, and Searching.

No comments:

Post a Comment