I put together a test SQL stored procedure, and set it as the Record Source for a new form in Access, but when I click on the "Add Existing Fields" button, I am presented with a message stating:
No fields available to be added to the current view.
The current recordsource may be invalid (for example, it may contain an invalid join expression), or there was some other problem gathering recordsource information for this object.
Below is a copy of the code, which runs fine and produces correct results in Query Analyer. Can anyone see what is wrong? I'm stumped...
CODE
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
---
ALTER proc pTest
as
set nocount on
---
create table #tblTest (xField1 varchar(10), xField2 int)
insert into #tblTest (xField1, xField2) values ('abc', '1')
insert into #tblTest (xField1, xField2) values ('def', '2')
insert into #tblTest (xField1, xField2) values ('ghi', '3')
select xField1, xField2 from #tblTest
drop table #tblTest
---
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
GO
SET ANSI_NULLS ON
GO
---
ALTER proc pTest
as
set nocount on
---
create table #tblTest (xField1 varchar(10), xField2 int)
insert into #tblTest (xField1, xField2) values ('abc', '1')
insert into #tblTest (xField1, xField2) values ('def', '2')
insert into #tblTest (xField1, xField2) values ('ghi', '3')
select xField1, xField2 from #tblTest
drop table #tblTest
---
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO