Results 1 to 3 of 3

Thread: about data access in tables

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 1999
    Location
    Khammam,Andhra Pradesh,India
    Posts
    5

    Post

    im working under ado and i've connected to oracle using ado and bounded the fields to three text boxes and all i want to do is i've placed three command buttons and named it as movefirst,movenext,and previous and just tell me the coding..of that buttons..
    im giving like this but it's not working

    p.sub command1_click()
    rs.movenext
    rs!ename=text1.text
    rs!empno=text2.text
    rs!sal=text3.text
    end sub

    please solve this problem..friends

    bye

    my email [email protected]

  2. #2
    New Member
    Join Date
    Jun 1999
    Location
    kaysville, Ut, US
    Posts
    13

    Post

    Are you using and ADO control? If so,it has the buttons you mentioned already on the control.

    If not, then are you getting an error message stating that rs is an unrecoginized object?

    I have been working with ado. To do what you are doing I had to create a subroutine, let's call it DoIt.

    private sub DoIt(Switch as string)
    select case Switch
    case "OPEN"
    open the connection and rs
    case "NEXT"
    rs.movenext
    case "PREV"
    rs.moveprevious
    case "LAST"
    rs.movelast
    case "FIRST"
    rs.movefirst
    case "CLOSE"
    close the connection
    close the recordset
    end sub

    Then in Command1_Click()

    private sub Command1_Click()
    DoIt "NEXT"

    etc...

    I had to do this because I couldn't get a recordset to be opened as a global or even module level object. I could only open it in a subroutine.

    But if you are using and ADO control it is done for you automatically.

  3. #3
    Lively Member
    Join Date
    Jan 1999
    Posts
    82

    Post

    Hi,

    Reverse your equal statements:
    text1.text=rs!ename
    text2.text=rs!empno
    text3.text=rs!sal

    Preeti


Posting Permissions

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



Click Here to Expand Forum to Full Width