Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > recordset name poblem

Reply
Thread Tools

recordset name poblem

 
 
Dr.Gizmo
Guest
Posts: n/a
 
      04-23-2004
Hello!

How can I generate random recordset name in do while loop, every time
that loop pass my code. example:

do while something

Set dpconn1 = spoj.Execute("SELECT * FROM txt WHERE number = 1")
if not dpconn1.EOF then
Do while not dpconn1.EOF

...

dpconn1.movenext
loop
end if
dpconn1.Close
set dpconn1 = Nothing

loop

so I want that name dpconn1 is different in every loop, for example in
second run it should be called dpconn2, and like that until do while
is not over...

I need this, because I'm calling function inside that same function,
so there would be the same recordset name, example:

function a1()
Set dpconn1 = spoj.Execute("SELECT * FROM txt WHERE number = 1")
if not dpconn1.EOF then
Do while not dpconn1.EOF

'++++this is a1 inside a1
Set dpconn1 = spoj.Execute("SELECT * FROM txt WHERE number = 2")
if not dpconn1.EOF then
Do while not dpconn1.EOF

'next is a1 inside a1, which is inside original a1, and so...
...

dpconn1.movenext
loop
end if
dpconn1.Close
set dpconn1 = Nothing
'++++

dpconn1.movenext
loop
end if
dpconn1.Close
set dpconn1 = Nothing
end function

thanx!

 
Reply With Quote
 
 
 
 
Ken Schaefer
Guest
Posts: n/a
 
      04-24-2004
Why are you doing what you are doing?

Cheers
Ken


"Dr.Gizmo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
: Hello!
:
: How can I generate random recordset name in do while loop, every time
: that loop pass my code. example:
:
: do while something
:
: Set dpconn1 = spoj.Execute("SELECT * FROM txt WHERE number = 1")
: if not dpconn1.EOF then
: Do while not dpconn1.EOF
:
: ...
:
: dpconn1.movenext
: loop
: end if
: dpconn1.Close
: set dpconn1 = Nothing
:
: loop
:
: so I want that name dpconn1 is different in every loop, for example in
: second run it should be called dpconn2, and like that until do while
: is not over...
:
: I need this, because I'm calling function inside that same function,
: so there would be the same recordset name, example:
:
: function a1()
: Set dpconn1 = spoj.Execute("SELECT * FROM txt WHERE number = 1")
: if not dpconn1.EOF then
: Do while not dpconn1.EOF
:
: '++++this is a1 inside a1
: Set dpconn1 = spoj.Execute("SELECT * FROM txt WHERE number = 2")
: if not dpconn1.EOF then
: Do while not dpconn1.EOF
:
: 'next is a1 inside a1, which is inside original a1, and so...
: ...
:
: dpconn1.movenext
: loop
: end if
: dpconn1.Close
: set dpconn1 = Nothing
: '++++
:
: dpconn1.movenext
: loop
: end if
: dpconn1.Close
: set dpconn1 = Nothing
: end function
:
: thanx!
:


 
Reply With Quote
 
 
 
 
Dr.Gizmo
Guest
Posts: n/a
 
      04-24-2004
"Ken Schaefer" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> Why are you doing what you are doing?
>
> Cheers
> Ken


....because, I'm building category list (tree view), and every category
may have unlimited subcategories, and so on...

I could solve this easily with loop in loop (f.e. ten times), but then
I would be limited to 10 level subcats, an I need it to be unlimited,
which requires changing name of record set in every loop dynamicly.

There is solution in 'execute' command:

dpconn1 = "RS"
strng = "Set "&dpconn1&" = spoj.Execute(""SELECT * FROM txtWHERE nivo
= "&nivonext&" AND prekat = '"&prekatnext&"'"")" & vbCrLf
strng = strng & ...
execute strng

But this solution is complicated, and I was wondering is there any
easier solution?
 
Reply With Quote
 
dlbjr
Guest
Posts: n/a
 
      04-24-2004
there are many far easier ways!

recordset objects are high priced items in code. Just think of the
processing burn on the server when 100 or more users hit the sight at the
same time.

Ouch!

dlbjr


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Install Poblem MATH::Pari Haydin Perl 0 03-18-2005 07:39 PM
poblem with Java ( XP SP2) Ruvim Pinka Java 5 11-19-2004 10:06 AM
outlook express newsgroups poblem Edward Doyle Computer Support 3 08-31-2004 07:26 PM
sudden over exposure poblem Enrico Palazo Digital Photography 2 02-04-2004 12:39 AM
RecordSet.Move or RecordSet.AbsolutePosition?? Hung Huynh ASP General 8 09-24-2003 11:07 AM



Advertisments