Moving through a recordset


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Moving through a recordset

  1. #1
    Join Date
    Aug 2006
    Posts
    2

    Moving through a recordset

    Hey all,

    I am having a hard time figuring out how to move through a recordset.

    I have an access database with 43 tables that I am connecting to via a Data Environment, one connection & commands. Here is a quick example of the main table I am working with.

    Week Game1 Game2 ..........
    1 251702 050202 ..........
    2
    ....

    There are a total of 17 fields in this table. The first one is "Week", the 2nd-17 are "Game1" through "Game16"

    I have no problems accessing the data for week 1. I can display it, manipulate it, do whatever I need to do. Here is the code I have been using to do so...

    For a = 0 To 15
    DataEnv1.rstbl_TeamID.MoveFirst
    intGame = DataEnv1.rstbl_SchYear.Fields("game" & (a + 1))
    StringParse (intGame)
    For b = 1 To 32
    strTeam = DataEnv1.rstbl_TeamID(1)
    DataEnv1.rstbl_TeamID.MoveNext
    If b = Int(intAway) Then
    lblAway(a).Caption = strTeam
    End If
    Next b
    Next a

    intGame selects the particlular game(a+1) field, and then I call a function called StringParse. It breaks down the text in the game1 field into a number of different integers. I created a label array to display the teams playing in each game (i.e. Miami @ Pittsburgh), which is what this code does, successfully.

    I am not sure, however, how to move to week 2. I am sure it is simple, but I do not know how to move to the 2nd row...

    Thanks in advance

    Scott

  2. #2
    Join Date
    Mar 2005
    Location
    UK, London
    Posts
    150
    Does the DataEnv1 have a recordset property?

  3. #3
    Join Date
    Aug 2005
    Location
    Hermosillo, Sonora, Mexico
    Posts
    103
    DataEnv1.rstbl_TeamID.MoveFirst
    Do until DataEnv1.rstbl_TeamID.EOF=True
    For a = 0 To 15
    intGame = DataEnv1.rstbl_SchYear.Fields("game" & (a + 1))
    StringParse (intGame)
    For b = 1 To 32
    strTeam = DataEnv1.rstbl_TeamID(1)
    DataEnv1.rstbl_TeamID.MoveNext
    If b = Int(intAway) Then
    lblAway(a).Caption = strTeam
    End If
    Next b
    Next a
    DataEnv1.rstbl_TeamID.Movenext
    Loop

Similar Threads

  1. Replies: 0
    Last Post: 11-13-2001, 11:34 AM
  2. Creating a Recordset
    By Scott in forum ASP.NET
    Replies: 0
    Last Post: 11-12-2001, 09:14 PM
  3. Requerying a reshaped recordset
    By Jonathan Gibbs in forum VB Classic
    Replies: 0
    Last Post: 08-09-2001, 02:34 PM
  4. Can't change field value in a recordset
    By Craig in forum VB Classic
    Replies: 5
    Last Post: 02-17-2001, 12:23 AM
  5. ?Build a Recordset from an Existing Recordset
    By Patrick in forum VB Classic
    Replies: 1
    Last Post: 10-11-2000, 11:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center