dcsimg
Results 1 to 13 of 13

Thread: [RESOLVED] Problem in unloading the ADODC when leaving the vb form

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2018
    Posts
    79

    Resolved [RESOLVED] Problem in unloading the ADODC when leaving the vb form

    When leaving the form, I came to know that form did not close fully. I can see square (form running symbol) on top of the vb window. May be I did not unload ADODC correctly. How can I unload the ADODC.

    PICTURE ATTACHED FYR.

    thank you all.
    Attached Images Attached Images  

  2. #2
    Frenzied Member
    Join Date
    Dec 2008
    Posts
    1,143

    Re: Problem in unloading the ADODC when leaving the vb form

    Don't use the Data Control
    The vast majority of experienced VB6 programmers do not use it.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2018
    Posts
    79

    Re: Problem in unloading the ADODC when leaving the vb form

    Any other alternatives?

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Apr 2018
    Posts
    79

    Re: Problem in unloading the ADODC when leaving the vb form

    Do I use Custom built tables and display records using select queries?

  5. #5
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    12,711

    Re: Problem in unloading the ADODC when leaving the vb form

    It may help if you showed some code. While I personally do not use the ADODC in any of my projects I have used the older data control and never ran into an issue like you are reporting. My guess is that it is something else at the heart of your problem.

  6. #6
    Frenzied Member
    Join Date
    Dec 2008
    Posts
    1,143

    Re: Problem in unloading the ADODC when leaving the vb form

    Quote Originally Posted by Vibrant_2018 View Post
    Any other alternatives?
    Make a copy of your project.
    Strip as much out of it as possible, BUT leaving enough to demonstrate your problem. AND ATTACH IT
    Maybe then myself or others can demonstrate how to do what you want, but using pure code.
    Rob

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Apr 2018
    Posts
    79

    Re: Problem in unloading the ADODC when leaving the vb form

    Just I want to populate the Database' Entire Columns & Rows on the form to edit. If I select a record using mouse click, the selected record goes to the another form for editing and updating process.
    I have done everything. It works fine. But the form does not close properly when I close the form after entering the form(where I have used ADODC). This is the issue to be rectified.

    Any suggestions?
    thank you

  8. #8
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    12,711

    Re: Problem in unloading the ADODC when leaving the vb form

    Without any idea how you have coded it there is not much to say. Somewhere you have did something wrong that is causing your problem. My first thought would be that you are hiding a form rather than unloading it and that is keeping your project running but of course that is just a guess would need to see code to know for sure.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Apr 2018
    Posts
    79

    Re: Problem in unloading the ADODC when leaving the vb form

    This is the complete code FYR:

    Code:
    Option Explicit
    
    ' PL SEE THE MODULE1 FOR VARIABLE DECLARATIONS Edit_EmpID, etc
    ' THEY HAVE BEEN DECLARED AS GLOBAL VARIABLES
    Private Sub DataGrid1_Click()
        
        Edit_EmpID = Adodc1.Recordset.Fields.Item(0)
        Edit_CreatedOn = Adodc1.Recordset.Fields.Item(1)
        Edit_CandidatesName = Adodc1.Recordset.Fields.Item(2)
        Edit_Age = Adodc1.Recordset.Fields.Item(3)
        Edit_Sex = Adodc1.Recordset.Fields.Item(4)
        Edit_CandidatesAddr = Adodc1.Recordset.Fields.Item(5)
        Edit_PartyName = Adodc1.Recordset.Fields.Item(6)
        Edit_CandidatesPhoto = Adodc1.Recordset.Fields.Item(7)
        Edit_CandidatesSymbol = Adodc1.Recordset.Fields.Item(8)
        
        UpdateCandidateDetailsFRM.Show
        Unload Me
        Exit Sub
    End Sub
    
    Private Sub btnClose_Click()
        msgboxResult = MsgBox("Do you want to Close the Window?", vbOKCancel + vbOKOnly, "Close the Window !")
        If msgboxResult = vbOK Then
            msgboxResult = ""
            Unload Me
            Exit Sub
        End If
        
        msgboxResult = ""
        Unload Me
        Exit Sub
    End Sub
    
    Private Sub Form_Load()
    
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
    
    End Sub
    thank you.

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Apr 2018
    Posts
    79

    Re: Problem in unloading the ADODC when leaving the vb form

    Somewhere you have did something wrong that is causing your problem. My first thought would be that you are hiding a form rather than unloading it and that is keeping your project running
    Sorry. You are correct. I forgot to go back to the form from where I actually came from. Now I added to go back to the parent form

    CANDIDATES_DETAILS_ADD.Show

    Everything works fine. Thank you all.

    One more question:
    While I personally do not use the ADODC in any of my projects...
    Don't use the Data Control
    The vast majority of experienced VB6 programmers do not use it.
    Can you please explain why? What are the other alternatives to use ADODC?

    thank you both BOOBLES & DataMiser

  11. #11
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    12,711

    Re: Problem in unloading the ADODC when leaving the vb form

    I always use ADO Code rather than the data control. Code gives you more control.

    There is a data form Wizard included with VB it will create a data form for you and has 3 options ADODC, ADO Code and ADO Class.
    You may want to create a couple of forms in a test project using the different methods so you can take a look and see how the wizard does it.

  12. #12
    Frenzied Member
    Join Date
    Dec 2008
    Posts
    1,143

    Re: Problem in unloading the ADODC when leaving the vb form

    Quote Originally Posted by Vibrant_2018 View Post
    One more question:
    Can you please explain why? What are the other alternatives to use ADODC?
    thank you both BOOBLES & DataMiser
    I agree with everything DataMiser has said
    Here is a vbforum tutorial on using ADO CODE -
    http://www.vbforums.com/showthread.p...for-Classic-VB

    Rob
    PS Once you have fallen in love with using ADO CODE (for getting/using recordsets),
    I can attach an example using ACTION queries, to do -
    - INSERT(aka append)
    - UPDATE
    - DELETE
    without having to retrieve a recordset
    But don't worry about that, until you are comfortable with ADO CODE

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Apr 2018
    Posts
    79

    Re: Problem in unloading the ADODC when leaving the vb form

    I already using ADO code throughout my Project except for one form(where I used ADODC). I can change it also to ADO code.
    Thank you both.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width