Hi all,
I am unable to derive a new class from ADODB.ConnectionClass. All I want to do is to override the 'Open' and 'Execute' methods but VB.net complains that all methods/properties must be overridden. So I have overridden all except for the default property 'ConnectionString'.
I realize that VB.Net does not support default properties unless they accept parameters. So how can I override the base default property if it does NOT accept parameters but my derived class must accept parameters??
-------------------------------------------------------
- When I define:
Default Public Overloads Overrides Property ConnectionString() As String
==> It complains parameters are required.
-------------------------------------------------------
- When I define:
Default Public Overloads Overrides Property ConnectionString(ByVal index As Integer) As String
==> It complains that it doesn't override a property in the base class (b/c it accepts parameters)
-------------------------------------------------------
- The following is what I need but I'm not sure how to work around it:
Default Public Overloads Overrides Property ConnectionString(ByVal index As Integer) As String
Get
ConnectionString = MyBase.ConnectionString
End Get
Set(ByVal Value As String)
MyBase.ConnectionString = Value
End Set
End Property
-------------------------------------------------------
- Any input would be greatly appreciated!!
thanks,
fed up
I am unable to derive a new class from ADODB.ConnectionClass. All I want to do is to override the 'Open' and 'Execute' methods but VB.net complains that all methods/properties must be overridden. So I have overridden all except for the default property 'ConnectionString'.
I realize that VB.Net does not support default properties unless they accept parameters. So how can I override the base default property if it does NOT accept parameters but my derived class must accept parameters??
-------------------------------------------------------
- When I define:
Default Public Overloads Overrides Property ConnectionString() As String
==> It complains parameters are required.
-------------------------------------------------------
- When I define:
Default Public Overloads Overrides Property ConnectionString(ByVal index As Integer) As String
==> It complains that it doesn't override a property in the base class (b/c it accepts parameters)
-------------------------------------------------------
- The following is what I need but I'm not sure how to work around it:
Default Public Overloads Overrides Property ConnectionString(ByVal index As Integer) As String
Get
ConnectionString = MyBase.ConnectionString
End Get
Set(ByVal Value As String)
MyBase.ConnectionString = Value
End Set
End Property
-------------------------------------------------------
- Any input would be greatly appreciated!!
thanks,
fed up