Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2001
    Posts
    135

    Unanswered: selecting next record(row)

    Hi folks
    I would like to know how can i get nextrecord (row)

    The main Ideia is:
    In the Forms i have a Field with a name
    the user ckick in a Right arrow and i get next Name
    If he click the left arrow i get the previous Record (row)

    By the way its not a grid

    I need to get only one , if i use select name from table
    where name >= @name , i will get several rows.

    i want to ger one by one

    tks
    carlos lages

  2. #2
    Join Date
    Feb 2002
    Location
    Sweden
    Posts
    34
    Use: select top 1 name from table where....
    - Jonte

  3. #3
    Join Date
    Jul 2003
    Location
    Penang, Malaysia
    Posts
    212
    You could also do it the other way, try designing your tables with at least one column specifiying the record count of each row.

    Lets say you name it "RecordID". Set it to type integer and Identity feature to "Yes, not for replication" in Enterprise Manager Design Table form.

    For every record you insert, a new "recordid" will be generated sequentially.

    You will not regard doing this, as most programming problems like yours could be solve easily by implementing this extra column.

    For your particular case , you could write something like:

    VB code:


    " declare @RecordCount as int"
    " set @recordcount=" &CurrentRecordCount & " + @recordcount "
    " select * from Table where Recordid = @RecordCount"


    You could play around this logic in various ways and situations.
    Last edited by Patrick Chua; 08-12-03 at 06:49.
    Patrick Chua
    LBMS ( Learn By My Self) NPQ ( No paper Qualification )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •