L
Lyle Fairfield
The Sproc is the record source for a report.
The Sproc builds a complicated string name @SQLString [varchar
(4000)].
At the end, it executes the string:
EXEC (@SQLString)
Everything is grand, almost.
Open the proc and one gets a datasheet showing of its records.
Open it in ADO and one gets a recordset.
Use it as the recordscource for a form or report and the
object shows its records.
Life is grand.
Introduce Application Roles. There is nothing in the database
window so forms and reports cannot use Sprocs, tables, views
or functions as recordsources. Solution -> use SQLStrings such
as "SELECT * FROM Table" or "EXEC Sproc".
Works well! EXCEPT in the case above for REPORTS.
Remember? The SPROC itself is executing a string, EXEC
(@SQLString).
The report recordsource cannot see the SPROC so we use, "EXEC
Sproc" (ie we are doubly EXECUTING) and it returns
GASP
a string; The first field of the first record contains "ALL".
And Access reports that it could not find the object "dbo.ALL
...."
Argggggggggggh! Am I nuts or is this too bizarre?
Solution: Change the Sproc to:
"SELECT (@SQLString)"
This works. But is it too wacko to include in a paid for and
relatively sensitive report justifying the employment of about
1400 employees at an average salary of $60-70 M CAD?
If you don’t use Application roles this may make no sense to
you whatever.
The Sproc builds a complicated string name @SQLString [varchar
(4000)].
At the end, it executes the string:
EXEC (@SQLString)
Everything is grand, almost.
Open the proc and one gets a datasheet showing of its records.
Open it in ADO and one gets a recordset.
Use it as the recordscource for a form or report and the
object shows its records.
Life is grand.
Introduce Application Roles. There is nothing in the database
window so forms and reports cannot use Sprocs, tables, views
or functions as recordsources. Solution -> use SQLStrings such
as "SELECT * FROM Table" or "EXEC Sproc".
Works well! EXCEPT in the case above for REPORTS.
Remember? The SPROC itself is executing a string, EXEC
(@SQLString).
The report recordsource cannot see the SPROC so we use, "EXEC
Sproc" (ie we are doubly EXECUTING) and it returns
GASP
a string; The first field of the first record contains "ALL".
And Access reports that it could not find the object "dbo.ALL
...."
Argggggggggggh! Am I nuts or is this too bizarre?
Solution: Change the Sproc to:
"SELECT (@SQLString)"
This works. But is it too wacko to include in a paid for and
relatively sensitive report justifying the employment of about
1400 employees at an average salary of $60-70 M CAD?
If you don’t use Application roles this may make no sense to
you whatever.