Sub cmdAddRecord_Click()
    ' Declare and instantiate the object variable
    Dim cnStateUBookstore As Connection
    Dim sSQL As String
    Set cnStateUBookstore = New Connection

    ' Establish a connection
    With cnStateUBookstore
        .Provider = "SQLOLEDB"
        .ConnectionString = "User ID=sa;" & _
                            "Data Source=MSERIES1;" & _
                            "Initial Catalog=StateUBookstore"
        .Open
    End With

    ' Build the SQL command
    sSQL = "INSERT INTO Students(First_Name, Last_Name) " & _
        "VALUES ('Lani', 'Ota')"

    ' Execute the SQL command
    cnStateUBookstore.Execute sSQL
End Sub