Solved

Close an ODBC Connection

Posted on 1998-07-02
2
136 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

730 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