Home > How-To Library > Database

How to create and call a stored procedure.

**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * ****************************************************************
Dim conn As ADODB.Connection Dim rst As ADODB.Recordset CREATE PROCEDURE ProcEmployees As Begin declare @Empcount as int Select @EmpCount = count(*) From Employees Return @Empcount End Set conn = New ADODB.Connection Set rst = New ADODB.Recorset conn.Provider = "Microsoft Jet 4.0 OLE DB Provider" conn.Open "Data Source=c:\database.mdb" rst = conn.execute "Call ProcEmployees"

If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.