The following SQL Server stored procedure example returns data from the "test" table.
CREATE PROCEDURE [dbo].[test_proc]
AS
BEGIN
SET NOCOUNT ON;
SELECT * from test
END
1. Add the test table or any other table to the project.
2. Add the following code to the List page: CustomQuery event:
Set ListQuery=DB_Query( "EXEC test_proc" )
3. Add the following code to the List page: FetchRecords event:
doAssignmentByRef ListFetchArray,rs.fetchAssoc()
4. Add the following code to the ListGetRowCount event:
doAssignmentByRef ListGetRowCount, tDAL.DBLookup("select count(*) from test")
See also:
•QueryResult object: fetchAssoc()
•How to execute stored procedures