Reply
Stored Procedure Hell
Old 10-30-2009, 08:46 AM Stored Procedure Hell
Ralpharama's Avatar
Junior Talker

Posts: 2
Name: Ralph
Location: UK
Trades: 0
Hello all, I just joined, and (is often the case) I have a problem perhaps someone could give me a pointer towards fixing. I've tried to keep this simple...

I have a stored procedure that has been working fine for years, but won't work on a different server, under certain circumstances. After pulling my hair out for a considerable amount of time I went back to basics and created a single, standalone page that called the SP.

Now, I get the same error everywhere and can't get this page to work at all. Perhaps someone can suggest what I'm doing wrong?

The error is:

Code:
Microsoft OLE DB Provider for SQL Server error '80040e10'
Procedure or function 'sp_CategorySearch' expects parameter '@keywords', which was not supplied.
sp_test.asp, line 20
This is the top of the stored procedure:

Code:
USE [MY_DATABASE]
GO
/****** Object:  StoredProcedure [dbo].[sp_CategorySearch]    Script Date: 10/28/2009 15:20:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
CREATE PROCEDURE [dbo].[sp_CategorySearch] (
    @keywords varchar(255),
    @dbfields varchar(255),
    @withinCategoryID int
) AS...etc
And this is the ASP calling page that throws the error:

Code:
<%
oDB = Null
db_username = "myusername"
db_pass = "mypassword"
db_server = "mydbserver"
db_network = "dbmssocn"
adOpenStatic = 3
Call db_connect(oDB, "MY_DATABASE")

Set cm = Server.CreateObject("ADODB.Command")
cm.ActiveConnection = oDB
cm.CommandText = "sp_CategorySearch"
cm.Parameters.Append cm.CreateParameter("@keywords", 129, &H0001, 1000)                ' 129 = adChar (string), &H0001 = adParamInput
cm.Parameters.Append cm.CreateParameter("@dbfields", 129, &H0001, 255)
cm.Parameters.Append cm.CreateParameter("@withinCategoryID", 3, &H0001)                ' 3 = adInteger (int)
cm.Parameters("@keywords") = "water"
cm.Parameters("@dbfields") = "CName"
cm.Parameters("@withinCategoryID") = 0
Set rsC = cm.Execute

db_disconnect(oDB)
%>
Where the db_connect() and dbdisconnect() are simple functions to open and close the connection.

Anyone any ideas about why this SP complains?! I'm willing to try just about anything!
Ralpharama is offline
Reply With Quote
View Public Profile Visit Ralpharama's homepage!
 
 
When You Register, These Ads Go Away!
Reply     « Reply to Stored Procedure Hell
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.09770 seconds with 13 queries