Saturday, March 19, 2011

Sample on how to create and call a stored procedure.


'How to create and call a stored procedure.
Dim conn As ADODB.Connection
Dim rst As ADODB.Recordset

CREATE PROCEDURE ProcEmployees As
Begin
    declare @Empcount as int                     
    Select @EmpCount = count(*) From EmployeesTable
    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:\Data1.mdb"
rst = conn.execute "Call ProcEmployees"

1 comments:

Lucas said...

Lovely blog you have hhere

Post a Comment

 
Powered by Blogger