Pipe2Path
Programmer
- Aug 28, 2001
- 60
Hello,
I've got a stored proc that inserts into a temp table, and returns a recordset. This works fine when I run it in SQL Analyzer, but when a function in VB6 tries to access the recordset just returned, I get an "Operation is not allowed when the object is closed" error. This happens if I try to access the contents of the recordset.
Question: Is it possible to return an open recordset from a temp table?
Any other ideas on how I could accomplish the same thing?
Thx
Kevin
STORED PROCEDURE CODE SNIPPET :
while @@fetch_status = 0
begin
if datediff(day, @MachineFNGWrnty, getdate()) <= 90
begin
select @UnderWarranty = 1
insert into AcctFNGWarranty
values (@MachineSerial,
@MachineModel,
@MachineFNGWrnty,
@UnderWarranty)
end
fetch next from cMachines into @MachineSerial, @MachineModel, @MachineFNGWrnty
end
close cMachines
deallocate cMachines
select * from AcctFNGWarranty
I've got a stored proc that inserts into a temp table, and returns a recordset. This works fine when I run it in SQL Analyzer, but when a function in VB6 tries to access the recordset just returned, I get an "Operation is not allowed when the object is closed" error. This happens if I try to access the contents of the recordset.
Question: Is it possible to return an open recordset from a temp table?
Any other ideas on how I could accomplish the same thing?
Thx
Kevin
STORED PROCEDURE CODE SNIPPET :
while @@fetch_status = 0
begin
if datediff(day, @MachineFNGWrnty, getdate()) <= 90
begin
select @UnderWarranty = 1
insert into AcctFNGWarranty
values (@MachineSerial,
@MachineModel,
@MachineFNGWrnty,
@UnderWarranty)
end
fetch next from cMachines into @MachineSerial, @MachineModel, @MachineFNGWrnty
end
close cMachines
deallocate cMachines
select * from AcctFNGWarranty