Solved

Stored procedures via asp

Posted on 2013-05-24
3
272 Views
Last Modified: 2013-05-30
Please help, I'm not a SQL guy.  Having trouble with closing a post survey on a stored procedure that works but cannot trigger it via asp.  This is a two part process with 2 asp pages and 2 stored procedures, the survey then a post thank you message and storage.  The first one works great.  In fact, I replaced the line  rs = C.Execute(sql) in Post with rs = C.Execute("sdnGetCallInfo '" + Request.QueryString("CallID")+ "'") from the Survey and the asp page actually display but, or course nothing records in the DB.  I attached the post.  Thanks for any advice...
Post.txt
0
Comment
Question by:captgriggs1
3 Comments
 
LVL 22

Accepted Solution

by:
Om Prakash earned 100 total points
ID: 39194981
please check that sdnGetCallInfo  has update statement to record survey

examples:

http://stackoverflow.com/questions/15092616/sql-server-stored-procedure-for-asp-classic
http://support.microsoft.com/kb/164485
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39195017
Your right. It is  a 2 step thing.  First you have a stored procedure in your sql database.  Then you will have asp/vb code to talk to the db/stored procedure. I like to have this as an include file as a function.

In this sample I have a SP called addNewThing in my db that accepts @newThing

<%
' include adovbs file
theID=AddNewThing("Tonka Truck")
response.write theID


Function AddNewThing(widget)

Set cmd = Server.CreateObject("ADODB.Command")
With cmd

   	.ActiveConnection = connMyConnection
    .CommandType = adCmdStoredProc
   	.CommandText = "addNewThing" ' name of your stored procedure
   
   	.Parameters.Append .CreateParameter("@newThing",adVarWChar, adParamInput, 50)
   	.Parameters("@newThing") = widget

   set rsName = .Execute
End With

 AddNewThing= rs(0) 
 
set cmd = nothing
set rs = nothing

end Function

%>

Open in new window

0
 

Author Closing Comment

by:captgriggs1
ID: 39207786
This helped get me on the right path.  Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

920 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

15 Experts available now in Live!

Get 1:1 Help Now