I have a stored procedure i SQL which I have created. I
want to be able to execute this procedure in VBA, thus
allowing it to read the values from the form's textboxes
and storing it into the parameter. How do I do so??
This is the codes in my stored procedure:
CREATE PROCEDURE insert_vendor
@VendorID VARCHAR (6),
@CompanyName VARCHAR (80)
AS
INSERT INTO tblVendors (VendorID, CompanyName) VALUES
(@VendorID, @CompanyName)
GO
This are the codes that I've tried out in VBA:
DoCmd.RunSQL "EXECUTE insert_vendor @VendorID =
strVendorID, @CompanyName = strCompanyName"
Thanks!
Douglas J. Steele - 17 Sep 2004 22:21 GMT
Assuming

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> I have a stored procedure i SQL which I have created. I
> want to be able to execute this procedure in VBA, thus
[quoted text clipped - 20 lines]
>
> Thanks!
Douglas J. Steele - 17 Sep 2004 22:22 GMT
Try
DoCmd.RunSQL "EXECUTE insert_vendor @VendorID = '" &
strVendorID & "', @CompanyName = '" & strCompanyName & "'"
Exagerated for clarity, that's
DoCmd.RunSQL "EXECUTE insert_vendor @VendorID = ' " &
strVendorID & " ', @CompanyName = ' " & strCompanyName & " ' "

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> I have a stored procedure i SQL which I have created. I
> want to be able to execute this procedure in VBA, thus
[quoted text clipped - 20 lines]
>
> Thanks!