Stored Procedure with Like

I have an SQL 2000 Stored procedure (see below) that is supposed to return all customernames that begin with ???.
 
CREATE PROCEDURE [dbo].[sp_CustomerName_Like]
       @CustomerName nvarchar(50)
AS

SELECT
      PeopleID,
      CustomerName,
      Address1,
       City,
      Zip
FROM
      People
WHERE
                CustomerName LIKE '%'  + @CustomerName + '%'
GO

I send in from a class the @Customername from VB 6

@CustomerName = "joh"

 strSQL = "sp_CustomerName_Like (" & mstrCustomerNameLike & ")"

And then I execute strSQL

I keep getting Incorrect syntax new 'joh'

What am I doing wrong?

Thanks
SheritlwAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DabasCommented:
Hi Sheritlw:
>  strSQL = "sp_CustomerName_Like (" & mstrCustomerNameLike & ")"
Try
 strSQL = "sp_CustomerName_Like ('" & mstrCustomerNameLike & "')"

Enclosing the parameter in single quotes

Dabas

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DabasCommented:
Sheritlw:
> @CustomerName = "joh"
Should that not be mstrCustomerNameLike = "joh"

Dabas
SheritlwAuthor Commented:
Hi Dabas,

Thank you, I can't believe I forgot the ' ' at the begining and end of the string.  

Thanks again,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.