Closed Thread
Results 1 to 4 of 4

Thread: MS Access

  1. #1
    moonrise is offline Learning Programmer
    Join Date
    May 2006
    Posts
    40
    Rep Power
    0

    MS Access

    I have a VB6 application which uses MS Access as its backend.

    Im familiar with Access and therefore how to place the record
    navigation buttons for:

    First Record
    Next Record
    Previous Record
    Last Record

    How would i code this in VB 6?

    I tried the following code on the first button but it doesnt go to the
    first record

    Code:
    rsExecDet.MoveFirst
    
    Me.txtRecordCaption = "Record " & rsExecDet.AbsolutePosition & " of " &
    intRecordCount
    Last edited by TcM; 01-24-2008 at 05:17 AM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    mrbar is offline Newbie
    Join Date
    Jan 2008
    Location
    Kuala Lumpur, Malaysia
    Posts
    10
    Rep Power
    0

    Talking Navigating MS Access from VB interface

    These are the codes i've done and so far it works well

    Code:
    Private Sub cmdFirst_Click()
        Adodc1.Refresh
        
        If txtName.Text = "" Then
            'Do nothing
        ElseIf Adodc1.Recordset.BOF = True Then
            'Do nothing
        Else
            Adodc1.Recordset.MoveFirst
        End If
    End Sub
    
    Private Sub cmdLast_Click()
        Adodc1.Refresh
        
        If txtName.Text = "" Then
            'Do nothing
        ElseIf Adodc1.Recordset.EOF = True Then
            'Do nothing
        Else
            Adodc1.Recordset.MoveLast
        End If
    End Sub
    
    Private Sub cmdPrev_Click()
        If txtName.Text = "" Then
            'Do nothing
        ElseIf Adodc1.Recordset.BOF = True Then
            'Do nothing
        Else
            Adodc1.Recordset.MovePrevious
        End If
    End Sub
    
    Private Sub cmdNext_Click()
        If txtName.Text = "" Then
            'Do nothing
        ElseIf Adodc1.Recordset.EOF = True Then
            'Do nothing
        Else
            Adodc1.Recordset.MoveNext
        End If
    End Sub
    Last edited by TcM; 01-24-2008 at 05:17 AM.

  4. #3
    v0id is offline Retired
    Join Date
    Apr 2007
    Posts
    2,937
    Blog Entries
    3
    Rep Power
    42
    Please remember to use the code-tags, both of you. It makes the text more readable.

  5. #4
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    I added the Code Tags.

    Anyways moonrise did you try mrbar code? did it work?

    I +rep mrbar for his effort.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 10-24-2010, 01:14 PM
  2. HELP.!!! Access and C#.!!
    By UbuntuX in forum C# Programming
    Replies: 8
    Last Post: 05-23-2010, 06:54 AM
  3. Array access through pointers vs. array access through indexes
    By DarkLordoftheMonkeys in forum C and C++
    Replies: 9
    Last Post: 01-16-2010, 05:01 PM
  4. OOP DB Access Wrapper
    By digioz in forum C# Programming
    Replies: 6
    Last Post: 09-07-2008, 10:58 AM

Tags for this Thread

Bookmarks

Posting Permissions

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