Jump to content

ASP -- > Store procedure SQL 2005


kastellu

Recommended Posts

Hello,At bottom you can see the code of SQL procedure that inserts the value to a table1. And the test asp page which has a form with where the value is insertet and submited. The problem is that i don t know how to send the value to an executed procedure , that is wrong and that is the reason why i get an error that the parameter for procedure is not provided. I know that i need to provide the Web value from a form at the time that the procedure is executed. Can you help me with this problem. The procedure in SQL works but when a button is submited the error ...Thanks,KASP test page

<form name = "test" action = "test.asp?sub=add" method = "POST"><input type = "text" name = "ValueWEB"><input type = "submit" name ="insert" value = "enter"></form><%ValueWEB = RequestForm("ValueWEB")set cnn = server.createobject("ADODB.Connection")cnn.open "PROVIDER = SQLOLEDB; DATA SOURCE = TESTSERVER; UID = sa; PWD = test123; DATABASE =db"If ValueWEB <> "" thencnn.testprocedureend if%>

testprocedure in SQL SERVER 2005

USE dbGOCREATE PROCEDURE testprocedure(   @ValueWEB varchar(30))ASINSERT INTO ValueTable(  Value)VALUES(  @ValueWEB)

Link to comment
Share on other sites

I don't use classic ASP, nor do I use ADO connections, but it appears to me that you are attempting to execute an unknown method on the connection object:

cnn.testprocedure

Looking at http://www.w3schools.com/ado/met_conn_execute.asp, you'll probably want to do something like this:

cnn.Execute("testprocedure");

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...