Stored procedure with two parameters

L

lemes_m

Hi all!

I have stored procedure "SPStorniranjeUKRP" with two parameters,
@VrNaloga (smallint) and @IdNaloga (smallint). When I try to execute
this procedure from VBA code (MS Access) I use following command:

DoCmd.RunSQL "EXEC SPStorniranjeUKRP @VrNaloga= " &
[Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogVrsta] & ", @IdNaloga= " &
[Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogId] & ""

I also tried:

DoCmd.RunSQL "EXEC SPStorniranjeUKRP @VrNaloga smallint= " &
[Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogVrsta] & ", @IdNaloga
smallint= " & [Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogId] & ""

Does someone knows what's wrong with this code. I mention that I tried
to run this SP with both parametars separately and it works fine.

Regards,

Mirnes Lemes
 
R

RoyVidar

(e-mail address removed) wrote in message
Hi all!

I have stored procedure "SPStorniranjeUKRP" with two parameters,
@VrNaloga (smallint) and @IdNaloga (smallint). When I try to execute
this procedure from VBA code (MS Access) I use following command:

DoCmd.RunSQL "EXEC SPStorniranjeUKRP @VrNaloga= " &
[Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogVrsta] & ", @IdNaloga= " &
[Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogId] & ""

I also tried:

DoCmd.RunSQL "EXEC SPStorniranjeUKRP @VrNaloga smallint= " &
[Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogVrsta] & ", @IdNaloga
smallint= " & [Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogId] & ""

Does someone knows what's wrong with this code. I mention that I tried
to run this SP with both parametars separately and it works fine.

Regards,

Mirnes Lemes

I'm assuming ADP, else you would need to open a connection, and execute
against it, I think - but did you also try something like this?

DoCmd.RunSQL "EXEC SPStorniranjeUKRP " &
[Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogVrsta] & ", " &
[Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogId]

i e, just pass the paremeters in the same order as they occur in the
SP?
 
G

Guest

Hi, I just need clarification:
Can I use docmd.runsql in ADP or not?
Access help explain that this command is ONLY for use in MDB, but on my
workstation command like
Docmd.RunSQL "INSERT INTO tblActivityTypes(ActivityType) VALUES (" & "'" &
NewData & "'" & ")" works without problem.
Is it possible to get error when you run ADP on some other workstation?
TNX

RoyVidar said:
(e-mail address removed) wrote in message
Hi all!

I have stored procedure "SPStorniranjeUKRP" with two parameters,
@VrNaloga (smallint) and @IdNaloga (smallint). When I try to execute
this procedure from VBA code (MS Access) I use following command:

DoCmd.RunSQL "EXEC SPStorniranjeUKRP @VrNaloga= " &
[Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogVrsta] & ", @IdNaloga= " &
[Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogId] & ""

I also tried:

DoCmd.RunSQL "EXEC SPStorniranjeUKRP @VrNaloga smallint= " &
[Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogVrsta] & ", @IdNaloga
smallint= " & [Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogId] & ""

Does someone knows what's wrong with this code. I mention that I tried
to run this SP with both parametars separately and it works fine.

Regards,

Mirnes Lemes

I'm assuming ADP, else you would need to open a connection, and execute
against it, I think - but did you also try something like this?

DoCmd.RunSQL "EXEC SPStorniranjeUKRP " &
[Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogVrsta] & ", " &
[Forms]![FRMUlazneKalkulacijeRPPr]![UKRPNalogId]

i e, just pass the paremeters in the same order as they occur in the
SP?
 

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