How to call a stored Procedure?

Iwock

New Member
simple, How do I call a stored procedure from a SQL database in asp+ VB code??Use ADO<BR><BR>http://msdn.microsoft.com/library/psdk/adsi/ds2prggd_ret_7ycf.htm<BR><BR>Basically you can do a straight execute i.e. con.Execute "sp_blah" <BR><BR>or set rs = con.Execute "sp_blah" <BR><BR>or use the command object - see examples in the link providedUh.... this is an ASP+ forum... your solution is for ASP, no? From my understanding the Set keyword is no longer supported in VB 7, so: Set objRs = con.Execute "sp_blah" will generate an errror.<BR><BR>In fact, it will generate an error is ASP since you do not have parens around "sp_Blah"Try this:<BR><script language="VB" runat=server><BR> Dim dsc As SQLDataSetCommand<BR> Dim ds As New DataSet<BR><BR> dsc = New SQLDataSetCommand("sp_MyStoredProc", "server=local;uid=sa;pwd=;database=MyDB")<BR> dsc.SelectCommand.CommandType = CommandType.StoredProcedure<BR> dsc.FillDataSet(ds, "MyTable")<BR></script><BR><BR>______________________________________<BR>Doug Seven<BR>CodeJunkies.Net / ASPNextGen.com<BR>[email protected]<BR><BR>Visit www.ASPNextGen.com or www.theFutureOfASP.com, both brought to you exclusively by CodeJunkies.Net, for tutorials and information on ASP+ - the next generation of Active Server Pages.<BR><BR>http://www.codejunkies.net
 
Back
Top