Solved

My AdBoolean Parameter is Being Ignored

Posted on 2008-06-24
4
1,054 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
Comment Utility
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
Comment Utility
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
Comment Utility
sorry.. try this

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

Author Comment

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

Cheers,

Rit
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now