C
Carify Me
Hi
I am new for developing component. Please advise me for the following
problem.
I have created the component (DLL) for opening dbconnection Using Oracle,
using the below statement to use the connection in my application.
--------------------------Standard EXE--------------------
Private oDB As My_Database_Connections.DBConn
Private adoConn As ADODB.Connection
If oDB.OpenDBConnection("ADMIN", "ADMIN") = 0 Then
Set adoConn = New ADODB.Connection
Set adoConn = oDB.mcnIBEW
MsgBox "Connection Established Successfully"
Else
MsgBox "Connection not Established"
End If
'I have another component (DLL) for checking some value in Database. I have
to use the same connection for that. Below coding is written also it is
working.
'In the below lines of coding, I am assigning the db connection adoConn to
the component (DLL)
Private Sub Command1_Click()
Dim sPatValue as String
Set myComVali = New My_General_Validations.Validations
Set myComVali.adoValidConn = adoConn
sPatValue = myComVali.FindDataAvailable("M", "Patient_Relation", "CODE")
End Sub
-----------------------------------------------------------------
for the above code I have declared 3 connection object.
1. Standard application Privatr adoConn
2. DBConnection (DLL) Public mcnIBEW
3. Validation logic (DLL) Public adoValidConn
----------------------------------------------------------------------
Every thing is working.
But I think this is not right way to do this,
Please advise me how to do this in better way.
Thanks & Regards
Balaji N
I am new for developing component. Please advise me for the following
problem.
I have created the component (DLL) for opening dbconnection Using Oracle,
using the below statement to use the connection in my application.
--------------------------Standard EXE--------------------
Private oDB As My_Database_Connections.DBConn
Private adoConn As ADODB.Connection
If oDB.OpenDBConnection("ADMIN", "ADMIN") = 0 Then
Set adoConn = New ADODB.Connection
Set adoConn = oDB.mcnIBEW
MsgBox "Connection Established Successfully"
Else
MsgBox "Connection not Established"
End If
'I have another component (DLL) for checking some value in Database. I have
to use the same connection for that. Below coding is written also it is
working.
'In the below lines of coding, I am assigning the db connection adoConn to
the component (DLL)
Private Sub Command1_Click()
Dim sPatValue as String
Set myComVali = New My_General_Validations.Validations
Set myComVali.adoValidConn = adoConn
sPatValue = myComVali.FindDataAvailable("M", "Patient_Relation", "CODE")
End Sub
-----------------------------------------------------------------
for the above code I have declared 3 connection object.
1. Standard application Privatr adoConn
2. DBConnection (DLL) Public mcnIBEW
3. Validation logic (DLL) Public adoValidConn
----------------------------------------------------------------------
Every thing is working.
But I think this is not right way to do this,
Please advise me how to do this in better way.
Thanks & Regards
Balaji N