none
A problem about Microsoft ADO Data Control 6.0

    Question

  • I use the Microsoft ADO data control 6, in a dialog box to query and display the data in SQLServer, it runs normally. But when I have gotten the data, the connection to the SQL Server exists all the time untill the dialog close.

    So,How can i shutdown the connecton to sql server after i have gotten the data?

    thanks.

     
    Tuesday, January 17, 2017 11:04 AM

Answers

  • Hi 董振军,

    This forum is discuss Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.

    According to your description, your problem is more related to ADO data control when developing. Please tell us what's your project type and which language do you use, which is benefit to us help you find the correct forum for your issue.

    And we often use ADO directly with following code.

    Dim conn As ADODB.Connection
    Dim rs As ADODB.Recordset
    

    And then we can close the connection after querying and displaying the data with following code.

    rs.Close
    Set rs = Nothing
    
    conn.Close
    Set conn = Nothing
    

    Best Regards,
    Weiwei


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by 董振军 Saturday, January 21, 2017 1:02 AM
    Wednesday, January 18, 2017 5:39 AM
    Moderator

All replies

  • Hi 董振军,

    This forum is discuss Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.

    According to your description, your problem is more related to ADO data control when developing. Please tell us what's your project type and which language do you use, which is benefit to us help you find the correct forum for your issue.

    And we often use ADO directly with following code.

    Dim conn As ADODB.Connection
    Dim rs As ADODB.Recordset
    

    And then we can close the connection after querying and displaying the data with following code.

    rs.Close
    Set rs = Nothing
    
    conn.Close
    Set conn = Nothing
    

    Best Regards,
    Weiwei


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by 董振军 Saturday, January 21, 2017 1:02 AM
    Wednesday, January 18, 2017 5:39 AM
    Moderator
  • Thanks for your reply. 

    I am studying database now.I used vc6 about 15years ago.now I have spare time to study subject which i am insteresting in before. I want to access sql server by  ADO data control with vc6.and when i have gotten data ,I want close the connect to sqlserver,so the app will not depand on the connect to sql server all the time.

    Thank you very much!


    • Edited by 董振军 Saturday, January 21, 2017 1:53 AM
    Saturday, January 21, 2017 1:03 AM