Solved

Close an ODBC Connection

Posted on 1998-07-02
2
139 Views
Last Modified: 2010-05-03
I have a data control with the RecordsetType set to SNAPSHOT, and the connect properties set to the proper values and I set the Data.Recordsource = "select name from customers order by name".  A MsFlexGrid is populated with the result of the query.  I just want to CLOSE the ODBC connection since the application does not need to connect to that database again, ho do I close that connection ?
0
Comment
Question by:aleporter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
AndreasSchindler earned 100 total points
ID: 1464881
Data.recordsource=""
data.refresh
for a Control

dim sn as Recordset
set sn=...
.
Set sn=nothing
for DAO Access

0
 

Author Comment

by:aleporter
ID: 1464882
Your answer is good for a certain type of situation, but in my case I only have this code, how could I close the connection to the database without exiting the application ?
(I have two msflexgrid controls in the form, grid2 populates with data1.recordsource and grid1 populates when the command1 button is clicked)

Private Sub Form_Load()
    Dim sql1 As String
    sql1 = "SELECT nro_prestador, nombre from prestadores order by nombre"
    Data1.RecordSource = sql1
End Sub

Private Sub Command1_Click()
    For i = 1 To Grid2.Rows - 1 Step 1
        Grid2.Row = i
        Grid2.Col = 0
        aux = Grid2.Text
        Grid2.Row = i
        Grid2.Col = 1
        auy = xGrid2.Text
        Grid1.AddItem aux & Chr(9) & auy
    Next i
End Sub
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question