ADO, Seek Command 
Author Message
 ADO, Seek Command

Having a mess o' seeks in my DAO/Jet old code,  I've been giving this a lot
of thought lately, i.e, duplicating SEEK functionality with SQL7.

I'm looking for ideas on the ability to walk through the entire data set in
different orders. For example....

In my VB app the user can PgDn / PgUp in the Last Name field and cycle
through the records in alphabetical order from BOF to EOF if they wanted to
(in JET Last_Name is indexed). Or further, they could type, say,  "SMITH",
then hit PgDn and scroll from that point on.  Same deal for the Phone Number
or City fields, etc.

Gee....anyone remember Dataflex? :)

The following abbreviated code works fine in DAO and even in
ADO/Jet.OLEDB.4.0, but I suspect I may have significant trouble using this
mentality with SQL7:

Sub Record_Next(rs As Recordset, Index%)
' Fired by the PgDn...Move to the next record in the index.
rs.Index = Main.ActiveForm.Field(Index%).Tag   ' Get the index name.
rs.Seek Main.ActiveForm.Field(Index%).Text, adSeekAfterEQ

    If rs.EOF And rs.RecordCount > 0 Then rs.MoveLast
    End If
If rs.EOF Or rs.RecordCount = 0 Then      ' End of file?
    Main.StatusPanel1 = "Find Past End Of File"
    If rs.RecordCount > 0 Then rs.MoveLast
    Exit Sub
End If
Call Fields_Write(rs)
End Sub

Anyone have any thoughts or comments? Is it beginning to sound like I may
have to start making copious use of bookmarks and record positions?


Wed, 13 Feb 2002 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Help: Seek command won't seek

2. ADO Command object and MSShape commands

3. Using the ADO Command Object to send an Execute command

4. sought after qbasic command?

5. sought after qbasic command?

6. Help with the SEEK command

7. seek command

8. Problem using SEEK command. VB4->Access

9. Lock on seek command

10. Linking Data1 scroll position with seek command result

11. Linking Data1 scroll position with seek command result

12. Help for seek command


Powered by phpBB® Forum Software