executing stored proc

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
 
S

Sylvain Lafontaine

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.)
 
V

Vadim Rapp

currentproject.connection.execute "exec sApptDateStaffFinalCCInsert " &
rstBR.fields(0),,adExecuteNoRecords
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top