From: Richard B. <rb...@us...> - 2005-04-11 00:32:42
|
Update of /cvsroot/jcframework/dotnet/Providers/AF_OLEDB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv815/Providers/AF_OLEDB Modified Files: AF_OLEDB.vbproj AssemblyInfo.vb COleDBConnection.vb COleDbDatabase.vb Log Message: Name changes to bring class library into line with Microsoft naming standards. FxCop directory added Nunit tests moved into main repository Index: COleDbDatabase.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_OLEDB/COleDbDatabase.vb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- COleDbDatabase.vb 22 Mar 2005 06:19:15 -0000 1.3 +++ COleDbDatabase.vb 11 Apr 2005 00:31:47 -0000 1.4 @@ -3,7 +3,7 @@ Imports System.Data.OleDb Imports System.Collections.Specialized -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -11,7 +11,7 @@ ''' '''----------------------------------------------------------------------------- ''' <summary> -''' Implementation of CRelationalDatabase for Microsoft Access and other OLEDB sources +''' Implementation of RelationalDatabase for Microsoft Access and other OLEDB sources ''' </summary> ''' <remarks>This class contains the specific functionality required for the ''' framework to interact with Microsoft Access databases and other OLEDB compliant @@ -21,7 +21,7 @@ ''' </history> '''----------------------------------------------------------------------------- Public Class COleDbDatabase - Inherits CRelationalDatabase + Inherits RelationalDatabase '************************************************** 'Class: CMsAccessDatabase @@ -142,23 +142,23 @@ ''' Establishes a new database connection. ''' </summary> ''' <returns>A COleDBConnection containing the newly established connection.</returns> - ''' <remarks>The COleDBConnection class implements the _CConnection interface which + ''' <remarks>The COleDBConnection class implements the IConnection interface which ''' is required by this method. ''' <para>If the connection cannot be established an exception will be thrown.</para></remarks> ''' <history> ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getNewConnection() As _CConnection + Public Overrides Function getNewConnection() As IConnection Dim conn As New COleDBConnection Try conn.Connection = New OleDbConnection If m_user Is Nothing OrElse m_user.Length = 0 Then m_user = "" m_password = "" - Dim pbroker As CPersistenceBroker + Dim pbroker As PersistenceBroker pbroker = getPersistenceBrokerInstance() - pbroker.GetLoginDetails(Me, m_user, m_password) + pbroker.GetLogOnDetails(Me, m_user, m_password) End If If m_user Is Nothing OrElse m_user.Length = 0 Then conn.Connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + m_name + ";" @@ -190,11 +190,11 @@ Dim aValue As Integer Dim row As System.Data.DataRow Dim p As OleDbParameter - Dim x As OIDException + Dim x As ObjectIdException Dim initvals() As Object = {1} Dim conn As COleDBConnection - conn = Me.getConnection(Nothing) + conn = Me.GetConnection conn.AutoCommit = False conn.startTransaction() Try @@ -222,7 +222,7 @@ conn.commit() Catch err As Exception conn.rollback() - x = New OIDException(err.Message, err) + x = New ObjectIdException(err.Message, err) Finally Me.freeConnection(conn) If Not x Is Nothing Then @@ -246,7 +246,7 @@ ''' [rbanks] 11/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getIdentityValue(ByVal conn As _CConnection) As Integer + Public Overrides Function getIdentityValue(ByVal conn As IConnection) As Integer Dim rs As New DataSet Dim da As New OleDbDataAdapter Dim cb As OleDbCommandBuilder @@ -289,13 +289,13 @@ ''' [rbanks] 23/01/2004 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overrides Function getParamHolder(ByVal i As Integer) As String + Public Overrides Function getParameterHolder(ByVal i As Integer) As String Return "?" End Function '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CRelationalDatabase.getClauseStringTableAlias">_CRelationalDatabase</see>. + ''' See <see cref="P:AToMSFramework.IRelationalDatabase.getClauseStringTableAlias">IRelationalDatabase</see>. ''' </summary> ''' <param name="table"></param> ''' <param name="pAlias"></param> @@ -309,7 +309,8 @@ Return table & " as " & pAlias End Function - Public Overloads Overrides Sub Dispose(ByVal disposing As Boolean) + Private m_disposed As Boolean + Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If Not m_disposed Then If disposing Then m_disposed = True Index: COleDBConnection.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_OLEDB/COleDBConnection.vb,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- COleDBConnection.vb 1 Apr 2005 00:04:36 -0000 1.3 +++ COleDBConnection.vb 11 Apr 2005 00:31:47 -0000 1.4 @@ -1,5 +1,5 @@ Imports System.Data.OleDb -Imports AToMSFramework +Imports AtomsFramework '''----------------------------------------------------------------------------- ''' Project : AToMSFramework @@ -9,7 +9,7 @@ ''' <summary> ''' Connection class for OLEDB data sources (specifically Microsoft Access) ''' </summary> -''' <remarks><para>This class implements the <see cref="T:AToMSFramework._CConnection"/> interface and is used +''' <remarks><para>This class implements the <see cref="T:AToMSFramework.IConnection"/> interface and is used ''' to manage connections to OLEDB datasources (specifically Microsoft Access).</para> ''' <para>The following should be taken into consideration when using this ''' class:</para> @@ -20,13 +20,13 @@ ''' first transaction created. A rollback on any nested transaction will cause all ''' outside transactions to also roll back.</para> ''' </remarks> -''' <seealso cref="T:AToMSFramework._CConnection"/> +''' <seealso cref="T:AToMSFramework.IConnection"/> ''' <history> ''' [rbanks] 28/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- Public Class COleDBConnection - Implements _CConnection + Implements IConnection Implements IDisposable '************************************************** @@ -41,7 +41,7 @@ Private m_transaction As OleDbTransaction Private m_transactioncalls As Integer Private m_references As Integer - Private m_db As _CRelationalDatabase + Private m_db As IRelationalDatabase Private Const DEBUG_MODE As Boolean = True Private m_disposed As Boolean @@ -64,13 +64,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.AutoCommit">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.AutoCommit">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 28/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property AutoCommit() As Boolean Implements _CConnection.AutoCommit + Public Property AutoCommit() As Boolean Implements IConnection.AutoCommit Get AutoCommit = m_autoCommit End Get @@ -81,13 +81,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.Started">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.Started">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property Started() As Boolean Implements _CConnection.Started + Public Property Started() As Boolean Implements IConnection.Started Get Started = m_started End Get @@ -98,13 +98,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ManageTransactions">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ManageTransactions">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ManageTransactions() As Boolean Implements _CConnection.ManageTransactions + Public Property ManageTransactions() As Boolean Implements IConnection.ManageTransactions Get ManageTransactions = m_manageTransactions End Get @@ -115,13 +115,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.commit">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.commit">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub commit() Implements _CConnection.commit + Public Sub commit() Implements IConnection.commit If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("COMMIT TRANSACTION") @@ -158,13 +158,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.startTransaction">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.startTransaction">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overloads Sub startTransaction() Implements _CConnection.startTransaction + Public Overloads Sub startTransaction() Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -184,17 +184,17 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processStatement">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' [rbanks] 23/01/2004 Changed to use SQL parameters ''' </history> '''----------------------------------------------------------------------------- - Public Sub processStatement(ByVal statement As CSqlStatement) Implements _CConnection.processStatement + Public Sub processStatement(ByVal statement As AtomsSqlStatement) Implements IConnection.processStatement Dim m_command As New OleDbCommand Dim m_recordcount As Integer - Dim cp As CSQLParameter + Dim cp As AtomsSqlParameter Dim param As OleDbParameter Try @@ -227,16 +227,16 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.processSelectStatement">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.processSelectStatement">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function processSelectStatement(ByVal statement As CSqlStatement) As CResultset Implements _CConnection.processSelectStatement + Public Function processSelectStatement(ByVal statement As AtomsSqlStatement) As ResultSet Implements IConnection.processSelectStatement SyncLock GetType(COleDBConnection) Dim x As RetrieveException - Dim rs As New CResultset + Dim rs As New ResultSet Dim param As OleDbParameter Dim dd As Date Dim m_command As New OleDbCommand @@ -247,7 +247,7 @@ m_command.Connection = m_connection m_command.CommandText = statement.SqlString - For Each cp As CSQLParameter In statement.Parameters + For Each cp As AtomsSqlParameter In statement.Parameters If Not cp.Ignore Then param = New OleDbParameter param.ParameterName = cp.Name @@ -277,14 +277,14 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="M:AToMSFramework._CConnection.rollback">_CConnection</see>. + ''' See <see cref="M:AToMSFramework.IConnection.rollback">IConnection</see>. ''' </summary> ''' <remarks></remarks> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub rollback() Implements _CConnection.rollback + Public Sub rollback() Implements IConnection.rollback If DEBUG_MODE Then If m_transactioncalls = 1 Then System.Diagnostics.Debug.WriteLine("ROLLBACK TRANSACTION") @@ -318,13 +318,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.CloseConnection">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.CloseConnection">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub CloseConnection() Implements _CConnection.CloseConnection + Public Sub CloseConnection() Implements IConnection.CloseConnection m_references -= 1 If m_references = 0 Then m_connection.Close() @@ -333,13 +333,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.IsClosed">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.IsClosed">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public ReadOnly Property IsClosed() As Boolean Implements _CConnection.IsClosed + Public ReadOnly Property IsClosed() As Boolean Implements IConnection.IsClosed Get Return m_connection.State = ConnectionState.Closed End Get @@ -347,13 +347,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.ReferenceCount">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.ReferenceCount">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Property ReferenceCount() As Integer Implements _CConnection.ReferenceCount + Public Property ReferenceCount() As Integer Implements IConnection.ReferenceCount Get Return m_references End Get @@ -364,13 +364,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.getTablesSchema">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.getTablesSchema">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements _CConnection.getTableSchema + Public Function getTableSchema(ByVal tName As String) As System.Data.DataTable Implements IConnection.getTableSchema Dim statement As String Dim cmd As OleDbCommand Dim dr As OleDbDataReader @@ -390,13 +390,13 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' See <see cref="P:AToMSFramework._CConnection.startTransaction">_CConnection</see>. + ''' See <see cref="P:AToMSFramework.IConnection.startTransaction">IConnection</see>. ''' </summary> ''' <history> ''' [rbanks] 1/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements _CConnection.startTransaction + Public Overloads Sub startTransaction(ByVal isolationLevel As System.Data.IsolationLevel) Implements IConnection.startTransaction If DEBUG_MODE Then If m_transactioncalls = 0 Then System.Diagnostics.Debug.WriteLine("BEGIN TRANSACTION") @@ -414,11 +414,11 @@ End If End Sub - Public Property Database() As _CRelationalDatabase Implements _CConnection.Database + Public Property Database() As IRelationalDatabase Implements IConnection.Database Get Return m_db End Get - Set(ByVal Value As _CRelationalDatabase) + Set(ByVal Value As IRelationalDatabase) m_db = Value End Set End Property @@ -452,7 +452,7 @@ Protected Overrides Sub Finalize() ' Simply call Dispose(False). Dispose(False) - MyBase.finalize() + MyBase.Finalize() End Sub End Class Index: AF_OLEDB.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_OLEDB/AF_OLEDB.vbproj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AF_OLEDB.vbproj 7 Feb 2005 07:37:54 -0000 1.1 +++ AF_OLEDB.vbproj 11 Apr 2005 00:31:47 -0000 1.2 @@ -20,8 +20,8 @@ OptionCompare = "Binary" OptionExplicit = "On" OptionStrict = "Off" - RootNamespace = "AF_OLEDB" - StartupObject = "" + RootNamespace = "AtomsFramework.Providers.OLEDB" + StartupObject = "AtomsFramework.Providers.OLEDB.(None)" > <Config Name = "Debug" @@ -70,7 +70,7 @@ AssemblyName = "System.Xml" /> <Reference - Name = "AToMSFramework" + Name = "Atoms.Framework" Project = "{8FFD05CF-E733-4D8E-BC0E-D9DD37B87384}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> Index: AssemblyInfo.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/Providers/AF_OLEDB/AssemblyInfo.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AssemblyInfo.vb 6 Apr 2005 06:34:22 -0000 1.2 +++ AssemblyInfo.vb 11 Apr 2005 00:31:47 -0000 1.3 @@ -29,5 +29,5 @@ ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: -<Assembly: AssemblyVersion("2.1.0.0")> -<Assembly: AssemblyFileVersion("2.1.0.0")> +<Assembly: AssemblyVersion("2.2.0.0")> +<Assembly: AssemblyFileVersion("2.2.0.0")> |