Search notes:

ADODB.Connection

The ADODB.connection represents a connection to an OLE-DB Data Source.

Interesting methods and properties

Some (imho) interesting methods and properties include
execute() Executes an SQL statement and returns a RecordSet object.
openSchema()
beginTrans(), commitTrans() and rollbackTrans() Used to manage transactions
.errors (property) contains a list of error objects.
open()

VBA function: Connect to Oracle

The following VBA function establishes an Oracle session:
private function openConnection(dbUser as string, dbPassword as string, dbName as string) as ADODB.connection ' {
on error goto err_
 
   dim cn as    ADODB.connection
   set cn = new ADODB.connection
 
   cn.open                            _
     "User ID="     & dbUser       & _
    ";Password="    & dbPassword   & _
    ";Data Source=" & dbName       & _
    ";Provider=OraOLEDB.Oracle.1"        ' '    Or, alternatively: ";Provider=MSDAORA.1"
 
   set openConnection = cn
 
   exit function
 
err_:
 
    if left(err.description, 9) = "ORA-01017" then ' invalid username/password; logon denied {
       msgBox "Not enough privileges to connect to the database", vbOKOnly + vbCritical, "nEXT Frontend"
       end
    end if ' }
 
    if left(err.description, 9) = "ORA-12514" then ' TNS:listener does not currently know of service requested in connect descriptor {
       msgBox "the database " & dbName & " seems to be down or not available", vbOKOnly + vbCritical, "nEXT Frontend"
       end
    end if ' }
 
    if left(err.description, 9) = "ORA-12154" then 'TNS:could not resolve the connect identifier specified {
       msgBox "The database name " & dbName & " is not known." & vbCrLf & "Is TNSNAMES.ORA configured correctly?", vbOKOnly + vbCritical, "nEXT Frontend"
       end
    end if ' }
 
    msgBox err.description
 
end function ' }

See also

The activeConnection property of the command object and the currentProject.connection property in the Access Object Model.
ADO

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758201194, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/ADO/objects/connection/index(94): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78