/// <summary>
        /// Appends data contained in ADO.NET DataTable object to path stored in OutputFileName property.
        /// </summary>
        /// <param name="dt">DataTable object containing data to be output.</param>
        /// <returns>True if output operation is successful. False if write fails.</returns>
        public bool AppendDataToOutput(DataTable dt)
        {
            bool       success = true;
            PFMsAccess db      = null;

            try
            {
                PFDataAccessObjects.AccessVersion accver = this.AccessVersion == enAccessVersion.Access2007 ? PFDataAccessObjects.AccessVersion.Access2007 : PFDataAccessObjects.AccessVersion.Access2003;
                if (File.Exists(_outputFileName) == false)
                {
                    PFMsAccess.CreateDatabase(this.OutputFileName, accver, this._replaceExistingFile, this.DbUsername, this.DbPassword);
                }
                db = new PFMsAccess(this.OutputFileName, this.DbUsername, this.DbPassword);
                db.OpenConnection();
                dt.TableName = this.TableName;
                db.ImportDataFromDataTable(dt);
                db.CloseConnection();
            }
            catch (System.Exception ex)
            {
                success     = false;
                _msg.Length = 0;
                _msg.Append(AppGlobals.AppMessages.FormatErrorMessage(ex));
                throw new System.Exception(_msg.ToString());
            }
            finally
            {
                if (db != null)
                {
                    if (db.IsConnected)
                    {
                        db.CloseConnection();
                    }
                    db = null;
                }
            }

            return(success);
        }
        /// <summary>
        /// Writes data contained in ADO.NET DataTable object to path stored in OutputFileName property.
        /// </summary>
        /// <param name="dt">DataTable object containing data to be output.</param>
        /// <returns>True if output operation is successful. False if write fails.</returns>
        public bool WriteDataToOutput(DataTable dt)
        {
            bool       success = true;
            PFMsAccess db      = null;

            try
            {
                if (File.Exists(_outputFileName))
                {
                    if (_replaceExistingFile)
                    {
                        File.SetAttributes(_outputFileName, FileAttributes.Normal);
                        File.Delete(_outputFileName);
                    }
                }
                PFDataAccessObjects.AccessVersion accver = this.AccessVersion == enAccessVersion.Access2007 ? PFDataAccessObjects.AccessVersion.Access2007 : PFDataAccessObjects.AccessVersion.Access2003;
                if (File.Exists(_outputFileName) == false)
                {
                    PFMsAccess.CreateDatabase(this.OutputFileName, accver, this._replaceExistingFile, this.DbUsername, this.DbPassword);
                }
                db = new PFMsAccess(this.OutputFileName, this.DbUsername, this.DbPassword);
                db.OpenConnection();
                dt.TableName = this.TableName;
                if (db.TableExists(this.TableName))
                {
                    if (this.ReplaceExistingTable == false)
                    {
                        _msg.Length = 0;
                        _msg.Append("ERROR: Table ");
                        _msg.Append(this.TableName);
                        _msg.Append(" exists and ReplaceExistingTable is False.\r\n");
                        _msg.Append("Output to Access database will be cancelled without any data output.");
                        throw new System.Exception(_msg.ToString());
                    }
                    bool dropSucceeded = db.DropTable(this.TableName);
                    if (dropSucceeded == false)
                    {
                        _msg.Length = 0;
                        _msg.Append("ERROR: Attempt to drop existing table ");
                        _msg.Append(this.TableName);
                        _msg.Append(" failed.\r\n");
                        _msg.Append("Output to Access database will be cancelled without any data output.");
                        throw new System.Exception(_msg.ToString());
                    }
                }
                db.CreateTable(dt);
                db.ReopenConnection();  //needed to make sure new table exists for subsequent statements
                db.ImportDataFromDataTable(dt);
                db.CloseConnection();
            }
            catch (System.Exception ex)
            {
                success     = false;
                _msg.Length = 0;
                _msg.Append(AppGlobals.AppMessages.FormatErrorMessage(ex));
                throw new System.Exception(_msg.ToString());
            }
            finally
            {
                if (db != null)
                {
                    if (db.IsConnected)
                    {
                        db.CloseConnection();
                    }
                    db = null;
                }
            }

            return(success);
        }