Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Stored procedures via asp

Posted on 2013-05-24
3
Medium Priority
?
278 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 22

Accepted Solution

by:
Om Prakash earned 300 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 53

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
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…

670 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