Y
Yarik
Hello,
Let's say there is a table named "Test" and the following stored
procedure:
ALTER PROC dbo.ShowTest
AS
SELECT * FROM Test
When I do the following code in Access
Call DoCmd.OpenStoredProcedure("dbo.ShowTest", acViewNormal,
acReadOnly)
everything works as advertised: Access opens the form displaying
whatever records are there in the table Test.
Now, let's say the stored procedure needs to re-create the table from
scratch; for example:
ALTER PROC dbo.ShowTest
AS
DROP TABLE Test
SELECT 'SomeValue' AS SomeField INTO Test
SELECT * FROM Test
In this case, MS Access says that the stored procedure "...did not
return any records..."
Is there any way to make OpenStoredProcedure() able to show the
recordset returned by the last SELECT statement in this stored
procedure?
(Actually, in my very first experiment, the stored procedure declared
a TABLE variable, filled it with records, and at the very end called
SELECT * FROM @TableVariable. In that case, the call to
OpenStoredProcedure produced the same result: no records returned.
Ideally, I would like to find a workaround for that case too, but
something tells me that it's not going to work...)
Any feedback would be greatly appreciated!
Thanks,
Yarik.
Let's say there is a table named "Test" and the following stored
procedure:
ALTER PROC dbo.ShowTest
AS
SELECT * FROM Test
When I do the following code in Access
Call DoCmd.OpenStoredProcedure("dbo.ShowTest", acViewNormal,
acReadOnly)
everything works as advertised: Access opens the form displaying
whatever records are there in the table Test.
Now, let's say the stored procedure needs to re-create the table from
scratch; for example:
ALTER PROC dbo.ShowTest
AS
DROP TABLE Test
SELECT 'SomeValue' AS SomeField INTO Test
SELECT * FROM Test
In this case, MS Access says that the stored procedure "...did not
return any records..."
Is there any way to make OpenStoredProcedure() able to show the
recordset returned by the last SELECT statement in this stored
procedure?
(Actually, in my very first experiment, the stored procedure declared
a TABLE variable, filled it with records, and at the very end called
SELECT * FROM @TableVariable. In that case, the call to
OpenStoredProcedure produced the same result: no records returned.
Ideally, I would like to find a workaround for that case too, but
something tells me that it's not going to work...)
Any feedback would be greatly appreciated!
Thanks,
Yarik.