ActiveX Data Objects (ADO) with Visual Basic

Connections

An ADO connection string typically has the following format: Provider=provider;Data Source=data-source;User ID=userid;Password=password

Where provider is one of the following.

Database Provider
Access Microsoft.Jet.OLEDB.4.0
DB2 IBMDADB2.1
Oracle MSDAORA.1 or OraOLEDB.Oracle.1
SQL Server SQLOLEDB.1
All MSDASQL.1 (MS OLE DB provider for ODBC)

Recordsets

Cursor Types

Use forward-only cursors wherever possible. If a forward-only cursor cannot be used, then use a Static cursor instead.

Cursor Location

Use a client-side cursor for SQL statements that return records, and a server-side cursor for everything else.

Lock Types

Lock Type Characteristics
adLockBatchOptimistic Rows are locked only long enough to write updates. Used with client-side cursors.
adLockOptimistic Rows are locked only long enough to write updates. Used with client-side cursors.
adLockPessimistic Only the current row in the recordset is locked till (1) cursor is moved to another row or (2) the recordset is closed. Used with server-side cursors.
adLockReadOnly Rows are never locked. Used with client or server side cursors.