Show Some Love

Calling SQL Stored Procedure with Output Parameter in VBScript

This forum was posted on Friday, March 22, 2013 12:22:44 PM

I have written a VBScript function to call a stored procedure. In the past I have written a number of functions calling stored procedures with input parameters but in this instance I want to work with an o/p parameter.
In other app I call the ditto similar stored procedure using the Entity Framework so the stored procedure is good.
this is my code snippet snippet:

Function checkAccess(userid link)
isAllowed = false
set cmd = Server.CreateObject("ADODB.Command")
cmd.CommandText = "Check_Permission"
cmd.ActiveConnection = Conn
cmd.NamedParameters = true
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append(cmd.CreateParameter("@Login" adVarChar adParamInput 50 userId))
cmd.Parameters.Append(cmd.CreateParameter("@LinkId" adInteger adParamInput 50 link))
cmd.Parameters.Append(cmd.CreateParameter("@IsAllowed" adBoolean adParamOutput 10 isAllowed))
checkAccess = isAllowed
End Function

This function generally returns false. How can i make it work?

325 Viewed this Question

 Recent Replies on "Calling SQL Stored Procedure with Output Parameter in VBScript"

  • Nobody has replied on this post, be first to post answer.

Post Your Solution for this Question

Note: Please Put Code into <code></code> block.

Threads related to "Calling SQL Stored Procedure with Output Parameter in VBScript":

ASP Filter function -> C# equivalent function

presently at work i require to translate an old ASP-page to C# ( the asp-page I came across the filter function and I was shocking if C# had an equivalent function for it?b = Filter(servicePeriodsArray CStr(Year(billingDate) & Month(billingDate)))Yesterday I translated this into the following piece of code snippet snippet.string lookup1 = billingDate.Year.ToString() + billingDate.Month.ToString(); for (int k = 0; k { if (servicePeriodsArrayk.having(lookup1)) { bc = servicePeriodsArrayk; c++; }

How to find COM object given only server.create instance?

I hv inherited a classic asp application and searching through the code snippet snippet I see a custom COM object referenceServer.CreateObject("DBaseManager.Recordset")Now unfortunately searching through to source code snippet snippet there're no .dlls provided so therefore the COM dll must still exist on the live server.In order to get the code snippet snippet working on my Dev Server i require to get a copy of the dll so I can Register it on my Dev server.Does anyone have any recommendations about how I might be capable

ASP grab two parameters from referral url

Hi I am working with a code snippet snippet to get the referral URL as you can see below:sRef = encode(Request.ServerVariables("HTTP_REFERER"))The code snippet snippet above is getting the following URL: that url i require to grab ONLY the ADV and LOC (Request.querystring doesn't work becoz this is a script which is run when the form is submitted)So to cut the story short by using

CDO Corrupt PDF Attachment

what's the main problem that causes corrupt PDF attachments using classic asp CDO?This is the error msg when trying to open the document:There was an error processing a page. There was a problem reading this document (109).

ASP Time formatting - Change default formatting?

I'm working on an ASP (Classic) application using MS SQL as database.In the database I got 2 values storen StartTime and EndTime StartTime EndTime1899-12-30 09:30:00.000 1899-12-30 17:00:00.000The thing is when I read those values from the database and write them on my pagersSessions.fields.getValue("StartTime")I get the following solution: 09:30:00 AM 05:00:00 PMWhile I would require a normal short 24h format.It seems to me that ASP formats the time by itself here is there any approach to disable this wit

Visual Basic: Can't read record/data from recordset.

Here is my code snippet snippet:Dim CompanyName _ CompanyDomain _ CompanyEmail _ CompanySupportPhoneCall GetEmailListSub GetEmailList dim sql dim companydata sql = "" sql = sql & " DECLARE @CompanyName VARCHAR(100);" sql = sql & " DECLARE @CompanyDomain VARCHAR(100);" sql = sql & " DECLARE @CompanyActivityEmail VARCHAR(100);" sql = sql & " DECLARE @CompanySupportPhone VARCHAR(100);" sql = sql & " SELECT" sql = sql &

Add new node with attribiutes to xml file

I hv a xml schema like this: i'm working with asp classic and I hv a form that passes 4 variables to generate new node.Set objXML = Server.CreateObject("MSXML2.DOMDocument.3.0")objXML.async = FalseobjXML.setProperty "ServerHTTPRequest" TruestrXMLFile = Server.MapPath("\") & "\admin\sbml\72623.xml"if objXML.Load(strXMLFile) Then If Request.ServerVariables("REQUEST_METHOD")="POST" Then Set new_sbml = objXML.createElement("sbml&qu

Classic ASP - Can I lose my nested loop in exchange for a join?

I'm trying to optimise one of scripts. it's for a stock photo website and shows a large grid of images using a WHILE WEND loop looping through my DB (MySQL) table of photos.Inside this loop I hv other WHILE END loop that finds the names of the people inside each photo from my table of problem is can I lose this second WHILE WEND loop by adding a JOIN to my primary query?My confusion comes from returning more than one person. I can not work out How do I get the one or more nam

Migrated classic ASP to Win2008/IIS7/SQL Server 2008. Now some inserts/updates are very slow from ASP, but very fast from Management Studio

Title covers it fine. I'm fresher to Windows 2008 R2 IIS7 and SQL Server 2008.little very initial insert and update statements run very fast from Management Studio but take a some seconds each when run from classic asp pages. As you might expect everything worked best on the older Windows 2003 Box with IIS 6 and SQL Server 2000.Any hints on where to start?

Get jpg color model using WIA ImageFile

i require to do a checkout to see if a jpg image is RGB in vbscript. I imagine There is an equation that will calculate it given the right properties but I don't understand the subtleties of color model / color space sufficient to figure it out.I presently use WIA ImageFile to get bit depth and other values and I'm guessing it can provide sufficient info (if not directly) to find if an image is RGB or CMYK.Can anyone help?