ADO Tips & Tricks

1)     Connection Object

a)      Opening the Database

b)      Executing Commands

c)       Executing Queries

d)      Closing the Database

2)     Recordset Object

a)      The Fields Collection

b)      Editing Records

3)     Tools

a)      One Column Queries

b)      ComboBox Example

c)       One Row Queries

d)      Multi-Column Queries

e)      Getting Field Names

f)        ComboBox Example, 2

4)     A Useful Example

a)      The SELECT Clause

b)      The WHERE Clause

c)       The Query

 

Download Example Programs

 

 

 

 

Executing Commands

Use the Connection's Execute method to execute SQL commands.

m_DBConnection.Execute _

    "CREATE TABLE Employees(" & _

        "LastName           VARCHAR(40)       NOT NULL," & _

        "MiddleName       VARCHAR(40)," & _

        "FirstName          VARCHAR(40)       NOT NULL," & _

        "EmployeeID        INTEGER              NOT NULL," & _

        "SSN                   CHAR(9)               NOT NULL," & _

        "Salary                CURRENCY          NOT NULL " & _

    ")"

 

 

m_DBConnection.Execute _

    "DROP TABLE Employees"