Solved

My AdBoolean Parameter is Being Ignored

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

832 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