Forums
 This topic is locked 
             Strored Procedure error in DMX
 Posted 03 May 2003  02:31:48 
  1 
     has   voted 
  03 May 2003  02:31:48 Phil Shevlin posted: 
 I am trying to use a stored procedure via Command.  All it does is return a recordset..asp code:
<pre id=code><font face=courier size=2 id=code>
<%
Dim cmdListings__UserEmail
cmdListings__UserEmail = "xyz" ' UserEmail is nvarchar(50) in the DB
if(Request("UserEmail"
Dim cmdListings__UserType
cmdListings__UserType = "xyz"
if(Request("UserType"
%>
<%
set cmdListings = Server.CreateObject("ADODB.Command"
cmdListings.ActiveConnection = MM_cnRealSite_STRING
cmdListings.CommandText = "american-listings.spShowListings"
cmdListings.Parameters.Append cmdListings.CreateParameter("@RETURN_VALUE", 3, 4)
cmdListings.Parameters.Append cmdListings.CreateParameter("@UserEmail", 200, 1,50,cmdListings__UserEmail)
cmdListings.Parameters.Append cmdListings.CreateParameter("@UserType", 200, 1,50,cmdListings__UserType)
cmdListings.CommandType = 4
cmdListings.CommandTimeout = 0
cmdListings.Prepared = true
set rsListings = cmdListings.Execute ' LINE 25
rsListings_numRows = 0
%>
</font id=code></pre id=code>
MS SQL code
<pre id=code><font face=courier size=2 id=code>
-- View Property Listings
CREATE PROCEDURE spShowLisings (@UserEmail nvarchar(50) = '', @UserType nvarchar(50) = '')
AS
IF @UserType = 'Admin'
BEGIN
SELECT * FROM vwListings
END
ELSE
BEGIN
SELECT * FROM vwListings
WHERE UserEmail = @UserEmail
END
GO
</font id=code></pre id=code>
The SP runs from in query analyzer. Yet it returns this error from DMX and when browsed:
======================
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver]Syntax error or access violation
/mylistings.asp, line 25
Edited by - wdglide on 03 May 2003 02:34:01
Replies
 Replied 03 May 2003  06:19:30 
   03 May 2003  06:19:30 Brent Colflesh replied: 
  What's around line 25?
Regards,
Brent
  
  Regards,
Brent
 Replied 03 May 2003  14:56:29 
   03 May 2003  14:56:29 Phil Shevlin replied: 
  Its the command.execute