Solved

My AdBoolean Parameter is Being Ignored

Posted on 2008-06-24
4
1,067 Views
Last Modified: 2012-05-05
Hi all,

I have the following ADO parameter but for some reason it doesn't seem to relate with my Stored Procedure:

Set cn = Server.CreateObject("ADODB.Connection")
   cn.Open strDSNless
   
   Set cmd = Server.CreateObject("ADODB.Command")
   Set cmd.ActiveConnection = cn
                     
 Dim rs2

 cmd.CommandText = "schedule_get_mailinglist"
 cmd.CommandType = adCmdStoredProc
                  
 cmd.Parameters.Append cmd.CreateParameter("@global", adBoolean, adParamInput, 1, True)
                  
 Set rs2 = Server.CreateObject("ADODB.RecordSet")
 rs2.CursorLocation = 3
 rs2.Open cmd


I have checked the name and data type of my stored procedure parameter and all seems correct....

the error I receive is:

[Microsoft][ODBC SQL Server Driver][SQL Server]Procedure 'schedule_get_mailinglist' expects parameter '@global', which was not supplied.

Does anyone have any ideas as to why it may not be working?

Many thanks,

Rit
0
Comment
Question by:rito1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 22

Expert Comment

by:neeraj523
ID: 21858959
Try this crude method for test..

<%
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open strDSNless
   
Set rs2 =  cn.Execute "schedule_get_mailinglist true"
%>
0
 
LVL 1

Author Comment

by:rito1
ID: 21859827
Hi neeraj523,

thanks for helping out.

Running your code, I seem to get an error at the moment...

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/schedules/test.asp, line 7

Set rs2 = cn.Execute "schedule_get_mailinglist true"
---------------------^
0
 
LVL 22

Accepted Solution

by:
neeraj523 earned 500 total points
ID: 21863348
sorry.. try this

Set rs2 = cn.Execute ("EXEC schedule_get_mailinglist true")
0
 
LVL 1

Author Comment

by:rito1
ID: 21882946
thanks neeraj523,
Got it sorted in the end. It was my fault and the spelling of parameters.

Cheers,

Rit
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question