Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get a list of all open ODBC connections

Status
Not open for further replies.

ineedhelplease

Technical User
Dec 18, 2002
18
US
I am able to open a new Oracle ODBC connection using:
Dim sConn As String, sSQL As String, sServer As String
Dim cnn As ADODB.Connection

'make oracle connection
Set cnn = New ADODB.Connection
sServer = "SSSSSSS"
cnn.Open "Driver={Microsoft ODBC for Oracle};" & _
"Server=" & sServer & ";" & _
"Uid= UUUUUUU;" & _
"Pwd= PPPPPPP"

'check if connection is made
If cnn.State = adStateOpen Then
MsgBox "Connection made!"
Else
MsgBox "Connection failed."
End If

'more code below this.
---------------------------

What I need is to be able to do is now get a list of all open Oracle ODBC connections so that:
1. I can check if one is established before letting another function use the connection
2. Close a connection using a sub/function different than the one that opened the connection.

Using connection strings are new for me, so I would appreciate any help.

Thank you.
 




Hi,

There is no ADODB.Connections collection.

Are YOU not controlling the connections?

If you have a variable number of connection, use an array and ReDim your array each time you open of close a connection.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top