I have a page where I use VB script to get three numbers from an Oracle sequence generator. The script runs correctly the first time the page is opened, getting three new numbers each time. If, however, I open the page again within the same session, the code appears to run again, but returns the same three numbers.

This should be impossible. I throw the numbers into recordsets which I set to nothing once I move to another page. There should be no residual values in the page. Could Oracle be giving the same three values to the select statements? How could that be possible?

'Get new identification numbers

dim permitnumber, permitdetail, appnewnumber



if Request.Form("category").Count=0 then


with rsPermitNumber
.Source = "SELECT SEQ_ENCROACHMENTS.NEXTVAL FROM DUAL"
'.ActiveConnection = objConnection
end with

rsPermitNumber.Open()

permitnumber = rsPermitNumber(0)
Response.Write("VBPermit=" &rsPermitNumber(0))

rsPermitNumber.Close()


with rsPermitDetail
.Source = "SELECT SEQ_ENCROACHMENTS.NEXTVAL FROM DUAL"
'.ActiveConnection = objConnection
end with

rsPermitDetail.Open()

permitdetail = rsPermitDetail(0)
Response.Write("VBDetail=" &rsPermitDetail(0))

rsPermitDetail.Close()

with rsApplicantNew
.Source = "SELECT SEQ_ENCROACHMENTS.NEXTVAL FROM DUAL"
.ActiveConnection = objConnection
end with

rsApplicantNew.Open()

appnewnumber = rsApplicantNew(0)

rsApplicantNew.Close()
Response.Write("SEQ VB Fired")
set rsPermitNumber = nothing
set rsPermitDetail = nothing
set rsApplicantNew = nothing

'There's some javascript in here to fill the values in the page

Else

End if

Thanks to anyone who can help ease this pain!