All Forums >> [Scripting] >> ASP >> Execute a Stored Procedure Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Posts: 19
Score: 0
Joined: 5/23/2001
From: India
Status: offline
That sounds simple enough to me. Just one thing, do I need to Open a recordset if I just want to execute a stored procedure and not return anything? Thanks very much for your help.
I believe you can simply open your connection then execute against the connection ( conn.Execute sqlQuery ) or you can open a recordset as detailed above but use the static cursor keyset. I list the cursor constants below...
here is a example right out of my .ASP page to open a DSN-less connection to SQL
Set Conn = server.CreateObject("ADODB.Connection") Conn.Open "driver=SQL
Server;server=yourserver.com;uid=userid;pwd=password;database=databasename;" Set RS = Conn.Execute("SELECT Count(*) AS Recs FROM [Copy-PartMaster Lite]
Where [STOCK_CODE] Like N'%" & pnum & "%' And [Description] Like N'%" & desc & "%'") Set RS1 = Conn.Execute("SELECT [STOCK_CODE], [Description], [SELLING_PRICE] FROM
[Copy-PartMaster Lite] Where [STOCK_CODE] Like N'%" & pnum & "%' And [Description] Like
N'%" & desc & "%'") Set RS2 = Conn.Execute("SELECT * From Customers Where [CUSTOMER] ='" & Customer