Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Asp with stored procedures...

Status
Not open for further replies.

Demis

Programmer
Jan 10, 2002
8
IN
can anyone help me how to use stored procedures in asp??

thax!!
 
Hi,

Perhaps, I could help you. I know Stored Procedures using Access but I'm not sure this syntax will still works in SQL. Try this!

Let's assume that you have Set the connection,recordset and Command so, you can have this syntax:

//using SELECT
//You have to create a query in access(ex. filename selectgroup)
//ex. I have these fields with the table name Addgroup
//the parameter is the data you will supply in your ASP code using adCmdStoredProc
PARAMETERS ID Long, GroupName Text ( 255 );
SELECT *
FROM AddGroup
WHERE AddGroup.ID=[ID] And AddGroup.GroupName=[GroupName]
ORDER BY AddGroup.GroupName;
//In your ASP try this
objCmd.CommandType = adCmdStoredProc
objCmd.CommandText = "selectgroup (" & Session("ID") & ",'" & Request.Form("GRname") & "')"
objCmd.Execute

I hope this would be of help...Delete,Insert & Update has different syntax than Select.

Regards:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top