proper syntax for executing a stored query w/parms from form?

M

Maggie

Hi,

I created a stored proc in sql server. The front-end is access, so I want to
execute it from a form. It works fine when I tested it in the query view. I
think my syntax is wrong. I'll paste in the stored proc, then what I'm trying
to do in the form:
Stored Procedure :
ALTER PROCEDURE dbo.UpdName
( @EnterClient varchar (8),
@cliname varchar(20) )
AS
UPDATE clients SET
ClientName = @cliname
WHERE
ClientID = @EnterClient
********************
code in Form :
dim EnterClient as varchar
dim cliname as varchar
I have tried these things below. Am I close ?!!
conn.Execute UPDname, EnterClient, cliname
and this:
conn.Execute UPDname & EnterClient &cliname
THANKS!!
 
M

Maggie

hi,
I think I got it now. It seems to work, although I got an error message the
first time. I tried to get more error messages, but I can't now for some
reason.
Here's what I did :
qrystr = " UPDname '" & EnterClient & "','" & clientname & "'"
conn.execute qrystr

I had my punctuation all wrong, plus I had included too many variables.
 

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