CrazyEngineers
  • why i am getting the following error in VB6.0?

    safwan

    Member

    Updated: Oct 26, 2024
    Views: 1.4K
    hi, i was just practicing my holiday assignment in vb6.0 i wrote an application which connect MS-ACCESS i connected it to default table biblie (some publishers title.)
    i took four command buttons and wrote following code for each.



    Private Sub cmdadd_Click()

    Data1.Recordset .AddNew

    txtadd.SetFocus

    End Sub

    Private Sub cmdlast_Click()
    Data1.Recordset .MoveLast

    End Sub

    Private Sub cmdnext_Click()
    Data1.Recordset .MoveNext

    End Sub

    Private Sub cmdprevious_Click()

    Data1.Recordset .MovePrevious
    End Sub

    Private Sub Command4_Click()

    Data1.Recordset .MoveFirst

    End Sub

    But when i press each button i get error
    "Compile errore
    Invelide or unqualified reference"
    can any one please help me what could be the reason .

    (Its not homework as i gave my code.)
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • shalini_goel14

    MemberJul 21, 2009

    Is this your complete code? Which line it is highlighting while giving compiler errror? Are there already any records in your database? Try checking once putting Data1.Recordset.eof [End of file] check
    Are you sure? This action cannot be undone.
    Cancel
  • safwan

    MemberJul 21, 2009

    Shallini .movenext line is highlighted when i press movenext button (command button ) in all command buttons same case

    and when i tried your code like "data1.recordset.eof " my vb setup stops working.
    Are you sure? This action cannot be undone.
    Cancel
  • shalini_goel14

    MemberJul 21, 2009

    Safwan if you will add it simply like this "data1.recordset.eof" how it will work tell?I mean to say , use it like this

    Private Sub cmdnext_Click()
    if(!Data1.Recordset.eof )
    Data1.Recordset .MoveNext
    end if
    End Sub

    1 suggestion[take it or ignore it your wish 😐 ]: First try only for 1 button rather than adding all at a time. When it works , go for rest.

    [PS: Grant excuse if any syntax errors are there in above snippet.]
    Are you sure? This action cannot be undone.
    Cancel
  • safwan

    MemberJul 22, 2009

    shallini i tried same like you as i have book but its also not working now i will try to connect oracle and see is it work or not then i will tell you.

    Any cEans if you can solve proble m the please help here.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register