Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / SQL Server / ADP / September 2005

Tip: Looking for answers? Try searching our database.

Stored Procedure Quits Early

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jpuls@sentinel.com - 21 Sep 2005 22:33 GMT
I'm having trouble getting a stored procedure to run from an Access
.adp project form.

The stored procedure runs fine from SQL Query Analyzer. It has no
inputs and no outputs, and takes about 3 minutes to run on a local copy
of SQL Server Developer Edition.

There are a series of User Configurable events that I can see happening
in SQL Profiler. When I try to run the stored procedure from an Access
form, it runs for a minute or so, then quits (I can see this in Task
Manager) with no error indication.

The test form is unbound, and has a single button with minimal On Click
event code:

Private Sub cmdTest_Click()
   MsgBox ("Before Procedure")
   CurrentProject.Connection.CommandTimeout = 60 * 10
   CurrentProject.Connection.Execute "dbo.pReassignCodes"
   MsgBox ("After Procedure")
End Sub

When the stored procedure quits early, the "After Procedure" message
box comes on.

I have db_owner permissions on the database in question.

Any suggestions would be gratefully appreciated!

Thanks,

Jim

Jim Puls
Sentinel Technologies
Philipp Stiefel - 22 Sep 2005 13:10 GMT
> I'm having trouble getting a stored procedure to run from an Access
> .adp project form.
[quoted text clipped - 17 lines]
>     MsgBox ("After Procedure")
> End Sub

The CommandTimeout-Property of the connection is _not_
inherited by Command-Object. To deal with that, try to
use an ADODB.Command-Object to run you SP.

Dim cmd as ADODB.Command
Set cmd = New ADODB.Command
With cmd
  Set .ActiveConnection = CurrentProject.Connection
  .CommandText = "dbo.pReassignCodes"
  .CommandType = adCmdStoredProc
  .CommandTimeout = 60 * 10
  .Execute
End with

HTH
Phil
jpuls@sentinel.com - 22 Sep 2005 16:21 GMT
Phil,

You are quite right! The ADODB command object works fine.

Thanks!

Jim

> > I'm having trouble getting a stored procedure to run from an Access
> > .adp project form.
[quoted text clipped - 34 lines]
> HTH
> Phil
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.