Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 send variables from .asp to .sql

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-08-22 : 21:38:33
renaud writes "1/I would like submit (send) user input (so the value of the string is unknown) from an .asp (who retrieve the user string form a form)to an .sql stored procedure.

Actually i call my stored proc. like this :

'Execute stored procedure in sql server
dim sql_dis
sql_dis="Exec sql_search"

sql stored proc. :

CREATE PROC sql_search
(
@FirstName CHAR(50),
@LastName CHAR(50)
) AS
SELECT * FROM table1 WHERE @LastName = '%userinputstring%'
RETURN

how must i send the value of the "user input string" to my stored proc.

2/if i want to send dynamicaly my .sql statement (directly from my .asp code):

Actually i use this code (but it doesn't work!!!):
(it's just a part of the code of course)

Set db = Server.CreateObject("ADODB.Recordset")
dim sql_search

sql_search = "SELECT * FROM table1 where @LastName like '%"&userinputstring&"%'"

db.Open sql_search

the problem is : i can't
   

- Advertisement -