473,698 Members | 2,097 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling Stored Procedure from an ASP Page

Hello,
I have a stored procedure named as

usp_CheckLogin with two parameters

as @usID, @Password

also values of these parameters are to be extracted using Request.Form from
the fields in the forms. Now How do I call this stored procedure from an ASP
Page using a Connection object in Server Tags <% %>. Also this stored
procedure returns a Numeric value as "RETURN_VAL UE". please give me the
syntax. This stored Procedure is a part of Session Management module.

thank you
May 29 '07 #1
2 2626
"anoop" wrote:
I have a stored procedure named as

usp_CheckLogin with two parameters

as @usID, @Password

also values of these parameters are to be extracted using Request.Form
from
the fields in the forms. Now How do I call this stored procedure from an
ASP
Page using a Connection object in Server Tags <% %>.
Take a look at the final section here, titled "Execute a stored procedure as
a native method of a Connection object". Your problem seems well-suited for
this approach:

http://msdn.microsoft.com/library/en...connection.asp

In other words, you can use an open connection like this:

objConn.usp_Che ckLogin strUserID, strPassword
Also this stored procedure returns a Numeric value as
"RETURN_VAL UE". please give me the syntax. This stored
Procedure is a part of Session Management module.
Returns? Would that be with a RETURN statement or a SELECT statement? The
answers are quite different.

If your procedure ends with...

SELECT xxx AS RETURN_VALUE

....then you can simply append a parameter and stick a recordset object
there...

objConn.usp_Che ckLogin strUserID, strPassword, objRS

....and read from the recordset as usual:

If objRS.Fields("R ETURN_VALUE").V alue = {whatever} Then
If, on the other hand, your procedure uses RETURN, you may have to use an
explicit command object:
http://msdn.microsoft.com/library/en...objcommand.asp


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.

May 29 '07 #2
anoop wrote:
Hello,
I have a stored procedure named as

usp_CheckLogin with two parameters

as @usID, @Password

also values of these parameters are to be extracted using
Request.Form from the fields in the forms. Now How do I call this
stored procedure from an ASP Page using a Connection object in Server
Tags <% %>. Also this stored procedure returns a Numeric value as
"RETURN_VAL UE". please give me the syntax. This stored Procedure is a
part of Session Management module.
http://groups.google.com/group/micro...09dc1701?hl=en

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
May 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6897
by: dw | last post by:
Hello all, I'm having a dickens of a time calling a stored procedure on a connection. Every time I do, it generates an error "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another." I've run the same stored procedure with the same exact list of arguments in Query Analyser in SQL Server, and it works. The page has the adovbs constants. Note that uspGetProperties is a stored procedure in SQL...
4
5761
by: Bob Murdoch | last post by:
I have an ASP application that calls a COM function to create a custom report as an Excel file. This works in a synchronous fashion, as long as the report does not take too long to create. If that happens, the session times out and we run into other kinds of problems. I have, in other cases, executed a stored procedure asynchronously (thanks to a tip from this group) thru ADO. I'm wondering if ASP provides some way of executing a...
18
19477
by: Jarrod Morrison | last post by:
Hi All I was wondering if there is a way to call a stored procedure from inside another stored procedure. So for example my first procedure will call a second stored procedure which when executed will return one record and i want to use this data in the calling stored procedure. Is this possible ? Thanks in advance
3
1469
by: Jack Black | last post by:
Help!! I'm trying to call a custom stored procedure from a VB.Net code-behind page in an ASP.Net application, and I keep getting an error with no real helpful info... Basically, I'm accepting a username and password from a front-end, and performing a simple INSERT into a SQL Server table via a custom stored procedure in the database. All privileges are fine, and the stored procedure works fine (inserts records perfectly; tested with...
2
2136
by: Woody Splawn | last post by:
I am using SQL Server 2000 as the back-end. I have created a stored procedure in SQL server called usp_AddContract. This Stored procedure inserts a new contract into a contracts table. I have tested the code in Enterprise Manager and it works correctly. At the time that I run the SP I pass a contract number and a SSN to the SP and it creates a new contract in the contracts table with a unique value in the ConNum field and SSN field. In...
2
1434
by: singlal | last post by:
Hi, my question was not getting any attention because it moved to 2nd page; so posting it again. Sorry for any inconvenience but I need to get it resolved fast. Need your help! **************************************************************************************************** Original Question: -------------------- Has anyone called a COBOL subroutine using COBOL CALL from a COBOL/DB2
4
6712
by: Jack | last post by:
Hi, I am trying to run an example code from a book. However I am getting the following error message: Number: -2147217900 Description: Syntax error or access violation Source: Microsoft OLE DB Provider for SQL Server SQLState: 42000
4
3582
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category order, Input field and a submit button. The Category name is being fetched from the oracle db along with the corresponding Category order. In the corresponding input field (text box) the user enters a new category order which gets stored in the...
6
7278
Soniad
by: Soniad | last post by:
Hello, I am excecuting a stored procedure in my ASP page , it has one out parameter (@confirm) . after executing the procedure i want to retreive this out parameter and assign it to variable (confirmation) declared in page. Dim RsSp , SQLSp Set RsSp = Server.CreateObject("ADODB.Recordset") SQLSp = "Declare @confirm varchar(1)" SQLSp = SQLSp & "Exec SendMsg_proc "& "'" & UniCode &"' , '" & DintUserId &"' , '" & DintOrg_id &"' ,...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9027
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8895
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.