databaseadministration.htm; updated 4/10/01

Database Administration

Introduction.


Functions of Data Administration vs. Database Administration.

Database Systems Development Lifecycle.
DBMS Components.
Additional Data Base Implementation Concepts. Organizing the DBA function.

Transaction Integrity.

Private Sub ArchiveInvoices()
' Either Archive all invoices or none of them.
ON Error GoTo ErrorHandler ' Turn on Error Handling
' Create the connection objects.
    Dim strSQL As String
    Dim cnAP As Connection
    Dim cmdInvoices As Command
    Set cnAP = New Connection
    Set cmdInvoices = New Command
    cnAP.CursorLocation = adUseClient
' Begin the transaction.
  cnAP.BeginTrans
    ' Place commands here to move records to an archive table
    ' and delete them from the Invoices table.
    cnAP.Open "Provider=SQLOLEDB;" & _
        "Server=myserver;" & _
        "Database=Accountspayable;" & _
        "User ID=me;Password=XYZ"
    cmdInvoices.ActiveConnection = cnAP
  ' Insert records into the Archive table from the Invoices table.
    strSQL = "INSERT INTO InvoiceArchive " & _
        "SELECT * FROM Invoices " & _
        "WHERE InvoiceTotal - " & _
        "PaymentTotal - CreditTotal = 0"
    cmdInvoices.CommandText = strSQL
    cmdInvoices.Execute
    ' Now delete records from the Invoices table.
    strSQL = "DELETE FROM Invoices WHERE " & _
        "InvoiceTotal - PaymentTotal - " & _
        "CreditTotal = 0"
    cmdInvoices.CommandText = strSQL
    cmdInvoices.Execute
    ' End the Transaction by committing it.
    cnAP.CommitTrans
    Exit Sub

Errorhandler:
' Display an error message and check to see if the edit mode is add
' for the recordset and if it is, then cancel the update to throw away
'  the blank record.  Rollback the transaction that failed.
    DisplayerrorMessage
    cnAP.RollbackTrans
    If rsInvoices.EditMode = adEditAdd Or _
            rsInvoices.EditMode = adEditDelete Then
      rsInvoices.CancelUpdate
    End If
End Sub


Concurrency Control.


DATABASE RECOVERY.



End of Notes.