473,241 Members | 1,448 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

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_VALUE". please give me the
syntax. This stored Procedure is a part of Session Management module.

thank you
May 29 '07 #1
2 2606
"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_CheckLogin strUserID, strPassword
Also this stored procedure returns a Numeric value as
"RETURN_VALUE". 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_CheckLogin strUserID, strPassword, objRS

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

If objRS.Fields("RETURN_VALUE").Value = {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_VALUE". 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
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...
4
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...
18
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...
3
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...
2
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...
2
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! ...
4
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...
4
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...
6
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...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.