By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

Creating Stored Procedure error

P: n/a
Trying to create a new stored procedure from code, running the code
below I just cut and pasted directly from the MS Knowledge Base, I get
the following error message:

Line 1: Incorrect syntax near 'prmCity'

Any ideas?
lq
Code:

Public Function CreateProc()

Dim strProc As String

strProc = "Create Procedure qryCustByCity " & _
"(prmCity varchar) as " & _
"select * from Customers where City = prmCity"

CurrentProject.Connection.Execute strProc

End Function
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 30 Oct 2003 14:18:53 -0800, la*************@hotmail.com (Lauren
Quantrell) wrote:

You forgot the @ sign. Try this:
strProc = "Create Procedure qryCustByCity " & _
"(@prmCity varchar) as " & _
"select * from Customers where City = @prmCity"

Note that an alternative to creating procedures on the fly is to send
the statement to a sproc that uses EXECUTE to run the passed in
statement.

-Tom.

Trying to create a new stored procedure from code, running the code
below I just cut and pasted directly from the MS Knowledge Base, I get
the following error message:

Line 1: Incorrect syntax near 'prmCity'

Any ideas?
lq
Code:

Public Function CreateProc()

Dim strProc As String

strProc = "Create Procedure qryCustByCity " & _
"(prmCity varchar) as " & _
"select * from Customers where City = prmCity"

CurrentProject.Connection.Execute strProc

End Function


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.