Im reciving this error:
Out of memory: 'rsItems.RecordCount'
On line:
temp=Int(RND * rsitems.RecordCount)
Hope you can help,
Thanks,
Billy
Out of memory: 'rsItems.RecordCount'
On line:
temp=Int(RND * rsitems.RecordCount)
Code:
<!--#INCLUDE VIRTUAL="connect.inc"-->
<%
'--------------Get Account ID Num--------------
Dim conn,rst
Dim Un(),NumRec,i
strsql ="SELECT * FROM tb_accounts"
rsItems.Open strSQL, adoCon
NumRec=4
ReDim Un(NumRec-1)
Randomize
for i=0 to NumRec-1
Un(i)=GetUnNumber
next
for i=0 to NumRec-1
rsitems.MoveFirst
rsitems.Move Un(i)
next
Function GetUnNumber
Dim temp,j
temp=Int(RND * rsitems.RecordCount)
for j=0 to NumRec-1
if temp=Un(j) then GetUnNumber
next
GetUnNumber=temp
End Function
response.write GetUnNumber
%>
Hope you can help,
Thanks,
Billy
