473,507 Members | 13,917 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating Stored Procedure error

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
1 2584
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
22092
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my...
5
6035
by: Lili | last post by:
I'm having problems creating a simple stored procedure in DB2. Can someone help? Here is the screen dump when I tried to load the stored procedure. Thanks for any help. Create procedure...
0
4255
by: Rhino | last post by:
I've written several Java stored procedures now (DB2 V7.2) and I'd like to write down a few "best practices" for reference so that I will have them handy for future development. Would the...
0
2551
by: billmiami2 | last post by:
Perhaps many of you MS Access fanatics already know this, but it seems that stored procedures and views are possible in Jet. I thought I would leave this message just in case it would help anyone....
4
24147
by: Coleen | last post by:
Hi All :-) Can anyone give me a URL where I can find a good example of code on how to create a temporary SQL table using VB.net? I've checked the Microsoft site at: ...
1
6336
by: Ir0neagle | last post by:
I am generating upgrade/new install scripts for my project. I am able to do this in oracle and sql server but an running into problems in db2. What I am trying to do is to use some logic to only...
2
6051
by: Andy | last post by:
Hi guys I having a problem creating a report in Access 2003 project talking to a SQL database through and ODBC connect. After hours of trying things from Access Help, MSDN and Google I still...
0
1808
by: mersis | last post by:
I have a very very annoying problem. I want to create a stored procedure, that creates a table and does various things with it. Before creating a stored procedure I check if the table is there. If it...
0
1078
by: Bhavesh D | last post by:
Hi Expert, I am facing below error while creating PO in 'Great plains' system via econnect layer. Actually we are exporting PO data from our system to Great plains vie econnect. ...
0
7109
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7029
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3190
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.