PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

How to check if sproc has finished

 
 
Robert
Guest
Posts: n/a
 
      7th Mar 2010
I have an Access 2007 ADP database using SQL Server 2008 Express and I need
to run several queries in succession. I am using code such as

Docmd.RunSQL "Exec sproc1 @p1, @p2 etc....
Docmd.RunSQL "Exec sproc2 @p1, @p2 etc....

I need to have some way to test if the first one has finished before the
second one starts. How can I do this?
 
Reply With Quote
 
 
 
 
Bob McClellan
Guest
Posts: n/a
 
      8th Mar 2010
Robert,
I would use ADO with an output param to get results.
If you opt not to do that then why not have one stored proc that
executes the others....

Create Proc sproc_Main
@p1 int --(or whatever),
@p2 int --(or whatever)
as
exec dbo.sproc1 @p1, @p2 etc....
exec dbo.sproc2 @p1, @p2 etc....


...bob

"Robert" <(E-Mail Removed)> wrote in message
news:Xns9D34A57D59739cpq1bcle@209.197.15.222...
>I have an Access 2007 ADP database using SQL Server 2008 Express and I need
> to run several queries in succession. I am using code such as
>
> Docmd.RunSQL "Exec sproc1 @p1, @p2 etc....
> Docmd.RunSQL "Exec sproc2 @p1, @p2 etc....
>
> I need to have some way to test if the first one has finished before the
> second one starts. How can I do this?


 
Reply With Quote
 
Robert
Guest
Posts: n/a
 
      8th Mar 2010
"Bob McClellan" <(E-Mail Removed)> wrote in
news:CAA6B281-B84F-44D7-89EC-(E-Mail Removed):

> Robert,
> I would use ADO with an output param to get results.
> If you opt not to do that then why not have one stored proc that
> executes the others....

ADO? How would I use ADO?
>
> Create Proc sproc_Main
> @p1 int --(or whatever),
> @p2 int --(or whatever)
> as
> exec dbo.sproc1 @p1, @p2 etc....
> exec dbo.sproc2 @p1, @p2 etc....
>
>
> ..bob
>
> "Robert" <(E-Mail Removed)> wrote in message
> news:Xns9D34A57D59739cpq1bcle@209.197.15.222...
>>I have an Access 2007 ADP database using SQL Server 2008 Express and I
>>need
>> to run several queries in succession. I am using code such as
>>
>> Docmd.RunSQL "Exec sproc1 @p1, @p2 etc....
>> Docmd.RunSQL "Exec sproc2 @p1, @p2 etc....
>>
>> I need to have some way to test if the first one has finished before
>> the second one starts. How can I do this?

>
>


 
Reply With Quote
 
Bob McClellan
Guest
Posts: n/a
 
      8th Mar 2010
> ADO? How would I use ADO?
here is an example...

Dim oCmd As Command, param As Parameter
Dim cn As New ADODB.Connection, sqlString As String

sqlString = "NewJobSites_CheckCount" 'PROC:
NewJobSites_CheckCount
Set oCmd = New ADODB.Command
Set cn = CurrentProject.Connection
Set oCmd.ActiveConnection = cn
oCmd.CommandText = sqlString
oCmd.CommandType = adCmdStoredProc
oCmd.CommandTimeout = 15


Set param = New ADODB.Parameter
param.Type = adInteger
param.Direction = adParamOutput
param.Name = "cnt" 'RETURN: Authenticated Flag
oCmd.Parameters.Append param

Me.JobCount = oCmd.Parameters("cnt")
oCmd.Execute , , adExecuteNoRecords

Set cn = Nothing

 
Reply With Quote
 
Marco
Guest
Posts: n/a
 
      8th Mar 2010
Friends and friends around the world.
We are presenting the new messenger.
He will be in the commissioning by the friends that we indicate to use the
system.
Access the system by clicking the link below and register free.

You get something for using orkut?
You get something for using skype?
You gain something by using twiter?
You get algumaocisa for using facebook?

Enjoy this is your time!!

Sign up and join for free.


http://www.sqipcom.com/?ref=webempreendedor

http://stakeholder.sqipcom.com/user/webempreendedor




"Robert" <(E-Mail Removed)> escreveu na notícia da
mensagem:Xns9D34A57D59739cpq1bcle@209.197.15.222...
> I have an Access 2007 ADP database using SQL Server 2008 Express and I
> need
> to run several queries in succession. I am using code such as
>
> Docmd.RunSQL "Exec sproc1 @p1, @p2 etc....
> Docmd.RunSQL "Exec sproc2 @p1, @p2 etc....
>
> I need to have some way to test if the first one has finished before the
> second one starts. How can I do this?


 
Reply With Quote
 
Robert
Guest
Posts: n/a
 
      10th Mar 2010
Thanks. So if an sproc calls 2 other sprocs the second one doesn't start
until the first one has finished?

"Bob McClellan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>> ADO? How would I use ADO?

> here is an example...
>
> Dim oCmd As Command, param As Parameter
> Dim cn As New ADODB.Connection, sqlString As String
>
> sqlString = "NewJobSites_CheckCount" 'PROC:
> NewJobSites_CheckCount
> Set oCmd = New ADODB.Command
> Set cn = CurrentProject.Connection
> Set oCmd.ActiveConnection = cn
> oCmd.CommandText = sqlString
> oCmd.CommandType = adCmdStoredProc
> oCmd.CommandTimeout = 15
>
>
> Set param = New ADODB.Parameter
> param.Type = adInteger
> param.Direction = adParamOutput
> param.Name = "cnt" 'RETURN: Authenticated Flag
> oCmd.Parameters.Append param
>
> Me.JobCount = oCmd.Parameters("cnt")
> oCmd.Execute , , adExecuteNoRecords
>
> Set cn = Nothing



 
Reply With Quote
 
vaslerio
Guest
Posts: n/a
 
      26th Mar 2010


"Robert" <(E-Mail Removed)> escreveu na notícia da
mensagem:Xns9D34A57D59739cpq1bcle@209.197.15.222...
> I have an Access 2007 ADP database using SQL Server 2008 Express and I
> need
> to run several queries in succession. I am using code such as
>
> Docmd.RunSQL "Exec sproc1 @p1, @p2 etc....
> Docmd.RunSQL "Exec sproc2 @p1, @p2 etc....
>
> I need to have some way to test if the first one has finished before the
> second one starts. How can I do this?


 
Reply With Quote
 
Guest
Posts: n/a
 
      4th Jun 2010


"Robert" <(E-Mail Removed)> escribió en el mensaje de
noticias:Xns9D34A57D59739cpq1bcle@209.197.15.222...
> I have an Access 2007 ADP database using SQL Server 2008 Express and I
> need
> to run several queries in succession. I am using code such as
>
> Docmd.RunSQL "Exec sproc1 @p1, @p2 etc....
> Docmd.RunSQL "Exec sproc2 @p1, @p2 etc....
>
> I need to have some way to test if the first one has finished before the
> second one starts. How can I do this?


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open hyperlink - how can I check the page has finished loading AltaEgo Microsoft Excel Programming 0 16th Mar 2010 08:01 PM
Outlooks checks mail second before first check finished Lady Veteran Microsoft Outlook 4 19th May 2005 03:17 PM
Running sproc in Access returns different rows to same sproc in QA =?Utf-8?B?U3RldmUnbw==?= Microsoft Access VBA Modules 2 27th Apr 2005 01:59 PM
Help with SPROC from .asp please... =?Utf-8?B?U3R1YXJ0?= Microsoft ADO .NET 2 9th Dec 2004 01:45 AM
Disconnect when finished check box Richard Microsoft Outlook 0 24th Jul 2003 10:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:32 AM.