Hi All,
Very new to this VB.Net lark but picking it up due to extensive knowledge of VBA in Excel & Access
I am creating an application that querys a specific table on an Oracle Database.
I can connect to the Database and query it no problem,
However I am unable to close the connection from within the form via my "CloseConnection" button
Here's how i open it:
So how do i close that specific connection? it does close if i close the form but i don't want that to be the way its done?
Hope you can help
Cheers
Very new to this VB.Net lark but picking it up due to extensive knowledge of VBA in Excel & Access
I am creating an application that querys a specific table on an Oracle Database.
I can connect to the Database and query it no problem,
However I am unable to close the connection from within the form via my "CloseConnection" button
Here's how i open it:
VB.NET:
Sub ConnectToServer()
Dim DSN As String = Replace(Me.CBConnection.Text,".WORLD","")
Dim UID As String = Me.TxtUsername.Text
Dim PWD As String = Me.TxtPassword.Text
Dim Cnx As OdbcConnection
Dim CnxStr As String
CnxStr = "DSN=" & DSN & ";UID=" & UID &" ;Pwd=" & PWD & ";"
Cnx = New OdbcConnection(CnxStr)
Cnx.Open()
'Enable BtnDisconnect
Me.BtnDisconnect.Enabled = True
Me.BtnConnect.Enabled = False
End Sub
So how do i close that specific connection? it does close if i close the form but i don't want that to be the way its done?
Hope you can help
Cheers