Moving around in dynaset?

Moving around in dynaset?

Post by Urpo Martikaine » Thu, 24 Apr 1997 04:00:00



A beginner-level question:
  Is there a clever way to move around in a dynaset; i.e. better than
just using arrow buttons with "moveNext" command.  Something like
scroll bars, which can move you - lets say 20 records forward?  My
intelligence is not enough to develop something in that line.

-  upi  -

 
 
 

Moving around in dynaset?

Post by Bill McCart » Thu, 24 Apr 1997 04:00:00



> A beginner-level question:
>   Is there a clever way to move around in a dynaset; i.e. better than
> just using arrow buttons with "moveNext" command.  Something like
> scroll bars, which can move you - lets say 20 records forward?  My
> intelligence is not enough to develop something in that line.

> -  upi  -

Yes you can do something like this.

Dim intCount as integer
For intCount = 1 to 20
   data1.recordset.movenext
next

If you are using the data control and don't want to see all the numbers
change during this, you can unbind the controls before the loop the
rebind them afterwards.

 
 
 

Moving around in dynaset?

Post by JustM » Mon, 28 Apr 1997 04:00:00




Quote:> A beginner-level question:
>   Is there a clever way to move around in a dynaset; i.e. better than
> just using arrow buttons with "moveNext" command.  Something like
> scroll bars, which can move you - lets say 20 records forward?  My
> intelligence is not enough to develop something in that line.

> -  upi  -

Hi Urpo !

Well, nothing easier than that.

put a ListBox and several Textboxes (i.e.) to your form.
TIP: do not use the data-control which you can set from the ToolBox.

then try s.th. like this:
---------------------------------------------------------------------------
First declare this variables in the global modul:

global daba as database
global rs as recordset
global st as string
---------------------------------------------------------------------------
then set the code like this:

Private Sub Form_Load()
 set daba=opendatabase("Your DataBase")
 set rs=daba.openrecordset("Your_Recorset")

while not rs.eof
   form1.list1.addnew rs.fields("Your_Field")
   rs.movenext
wend
rs.movefirst

end sub

Private Sub List1_Click()
 ' ' works fine if the field is not duplicated (use index) for that
  st = "select * from your_Recordset where your_fields=" & " ' " &_
            Form1.List1.text & " ' "
 Set rs = daba.OpenRecordset(st)
 Form1.Text1.text = rs.Fields("your_Field")
          ...  go on like this ...
End Sub

this is the way I use in my progs.

regards,
Paul
--
**********************************************************
      happy hearts fall by my stupid hearts

 
 
 

Moving around in dynaset?

Post by Henry La » Tue, 29 Apr 1997 04:00:00




Quote:

>put a ListBox and several Textboxes (i.e.) to your form.
>TIP: do not use the data-control which you can set from the ToolBox.

small snip ...

Quote:

>Private Sub Form_Load()
> set daba=opendatabase("Your DataBase")
> set rs=daba.openrecordset("Your_Recorset")

NB you can't do this if you're an amateur like me and can only afford
the Standard edition: you have to use the data control.

Manchester, England
 
 
 

1. Speed of moving thru dynaset (or snapshot)

I have a table with 2 keys. Primary is: "Dept" and "Name". The Secondary
is:
"Name" and "Dept".
When I create a dynaset from this table using an SQL stmt with a where
clause that includes the "Dept" field and the "Name" field, I can
"MoveNext" thru it very fast. (~- 1 sec). If I create a dynaset using an
SQL stmt with a where clause that only includes the "Name" field, it can
take me up to 15 to 20 secs to "MoveNext" thru it. (Both have ~= 50 recs)
My question: If the first SQL stmt uses the primary key, does the second
SQL stmt use it also? It certainly doesn't appear to. My understanding is
that a Dynaset returns a keyset to the records. This appears to be the
case for the first Dynaset which refers to both fields that make up the
"primary" key. The second Dynaset seems to fall into the situation of the
"MoveNext" actually moving thru the records based on their position in
the table when added.
Any ideas on this type of a situation? Does a Select stmt use a Primary
or Secondary key?

Thanks

Brian

2. New Server Object Using VB5?? Howto??

3. move table around tablespaces

4. sugestion to FileMaker

5. moving sql 7 db's around

6. Test

7. Objects moving around on reports

8. How can I know what process/program that Invoke the Trigger ?

9. Moving Text around in TEXT data types

10. Newbie - Moving around (scrambling) data?

11. Best way to load/move data around?

12. moving around in an open recordset

13. Programmaticaly moving around pageframes