Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 temporal table & SP

Author  Topic 

shifis
Posting Yak Master

157 Posts

Posted - 2006-04-11 : 17:51:06
I do the next SP that returns a temporal table

CREATE PROCEDURE spValidaRangoTarj
@intNoTarjIni as float,
@intNoTarjFin as float

AS

CREATE TABLE #TEMP_TBTARJREP
(
noTarjeta varchar(20),
status varchar(1)
)

if dbo.F_BuscaRangoTarj(@intNoTarjIni,@intNoTarjFin)=1
begin
INSERT #TEMP_TBTARJREP(noTarjeta,status)
select noTarjeta, status
from tbTarjetas
where CONVERT(float,noTarjeta,1) between @intNoTarjIni and @intNoTarjFin
end
else
BEGIN
INSERT #TEMP_TBTARJREP(noTarjeta,status)
values('OK',' ')
END

SELECT * FROM #TEMP_TBTARJREP
GO



Then in VB6.0 I uses the next code to call the SP, but in the line (If adoRS.EOF And adoRS.BOF Then) VB send me a run time error '3704', operation is not allow when the object is closed. This have something to do with the temporal table that I'm try to return?


Set adoRS = New ADODB.Recordset

gstrSQL = "sptest 1,100"
adoRS.Open gstrSQL, gcnSQL, adOpenForwardOnly, adLockReadOnly, adCmdText

If adoRS.EOF And adoRS.BOF Then 'No encontro

iminore
Posting Yak Master

141 Posts

Posted - 2006-04-11 : 18:32:08
In your VB you've got procedure sptest when it's actually called spValidaRangoTarj.
Go to Top of Page
   

- Advertisement -