executing stored proc

  • Thread starter Thread starter Andy G
  • Start date Start date
A

Andy G

This is not throwing an error but it is not running the stored procedure
either...any ideas?

Thanks.


'Insert the apptSchdBuild record
Dim cmdInsrt As New ADODB.Command
With cmdInsrt
.ActiveConnection = CurrentProject.Connection
.CommandText = "sApptDateStaffFinalCCInsert"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@ID", adBigInt,
adParamInput, 15, rstBR.fields(0))
.Execute Options:=adExecuteNoRecords
End With
 
Use a "On Error Goto 0" or in the VBA window: Options -> General -> Error
Trapping, choose "Break on All Errors" to make sure that no VBA errors are
generated.

The size of a BigInt is 8 - not 15 - so remove this value (you don't need
it).

It is also possible that the syntax « rstBR.fields(0) » is confusing the
system; try with an intermediary local DIM variable.

Try adding dbo. before the name of the SP.

And finally, add a Set for the Active connection statement:

Set .ActiveConnection = CurrentProject.Connection

(Otherwise, you are only assigning the string connection and not the
connection object; something that will result in a decreased overall
performance.)
 
currentproject.connection.execute "exec sApptDateStaffFinalCCInsert " &
rstBR.fields(0),,adExecuteNoRecords
 
Back
Top