Solved

My AdBoolean Parameter is Being Ignored

Posted on 2008-06-24
4
1,066 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error in query expression 3 56
ASP AND XML 3 41
SP result not being displayed 5 69
isNaN issue on the Table input text 2 41
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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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