Gambas/libraries/gb.db/Connection: Difference between revisions

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
No edit summary
 
Identifiers: more information
Line 24: Line 24:
|-
|-
| valign=top |
| valign=top |
* [[Charset (gb.db.Connection)|Charset]]
* [[Charset (gb.db.Connection)|Charset]]() AS String [[read-only property|(r)]]
* [[Databases (gb.db.Connection)|Databases]]
* [[Databases (gb.db.Connection)|Databases]] AS [[.ConnectionDatabases (gb.db)|.ConnectionDatabases]]
* [[Host (gb.db.Connection)|Host]]
* [[Host (gb.db.Connection)|Host]] AS String
* [[Login (gb.db.Connection)|Login]]
* [[Login (gb.db.Connection)|Login]] AS String
* [[Name (gb.db.Connection)|Name]]
* [[Name (gb.db.Connection)|Name]] AS String
* [[Password (gb.db.Connection)|Password]]
* [[Password (gb.db.Connection)|Password]] AS String
* [[Port (gb.db.Connection)|Port]]
* [[Port (gb.db.Connection)|Port]] AS String
* [[Tables (gb.db.Connection)|Tables]]
* [[Tables (gb.db.Connection)|Tables]] AS [[.ConnectionTables (gb.db)|.ConnectionTables]]
* [[Type (gb.db.Connection)|Type]]
* [[Type (gb.db.Connection)|Type]] AS String
* [[Users (gb.db.Connection)|Users]]
* [[Users (gb.db.Connection)|Users]] AS [[.ConnectionUsers (gb.db)|.ConnectionUsers]]
* [[Version (gb.db.Connection)|Version]]
* [[Version (gb.db.Connection)|Version]] AS Integer [[read-only property|(r)]]
| valign=top |
| valign=top |
* [[Begin (gb.db.Connection)|Begin]]
* [[Begin (gb.db.Connection)|Begin]]()
* [[Close (gb.db.Connection)|Close]]
* [[Close (gb.db.Connection)|Close]]()
* [[Commit (gb.db.Connection)|Commit]]
* [[Commit (gb.db.Connection)|Commit]]()
* [[Create (gb.db.Connection)|Create]]
* [[Create (gb.db.Connection)|Create]]( <u>Table</u> AS String ) AS [[Result (gb.db)|Result]]
* [[Edit (gb.db.Connection)|Edit]]
* [[Edit (gb.db.Connection)|Edit]]( <u>Table</u> AS String {{optargs|, Request AS String, Arguments AS , ...}} ) AS [[Result (gb.db)|Result]]
* [[Exec (gb.db.Connection)|Exec]]
* [[Exec (gb.db.Connection)|Exec]]( <u>Request</u> AS String, Arguments AS {{optargs|, ...}} ) AS [[Result (gb.db)|Result]]
* [[Find (gb.db.Connection)|Find]]
* [[Find (gb.db.Connection)|Find]]( <u>Table</u> AS String {{optargs|, Request AS String, Arguments AS , ...}} ) AS [[Result (gb.db)|Result]]
* [[Open (gb.db.Connection)|Open]]
* [[Open (gb.db.Connection)|Open]]() AS Boolean
* [[Quote (gb.db.Connection)|Quote]]
* [[Quote (gb.db.Connection)|Quote]]( <u>Name</u> AS String ) AS String
* [[Rollback (gb.db.Connection)|Rollback]]
* [[Rollback (gb.db.Connection)|Rollback]]()
|}
|}

Revision as of 15:50, 5 December 2006

computing: software: programming: Gambas: gb.db.Connection

Overview

The gb.db.Connection class provides an interface to a particular database engine connection. It is similar to the Connection interface in ADO.

Usage

To connect to a database server: create a connection object, fill the needed properties, and call the Open method.

For SQLite connections, the following algorithm is used:

  • If Name is null, then a memory database is opened.
  • If Name is an absolute path, then this path is used.
  • If Name is a relative path, then:
    • If Host is null, then the database is located in the application temporary directory, which is /tmp/gambas.$UID/sqlite .
    • Otherwise, Host gives the database directory, and the database path is the result of concatenating Host and Name.

This class is creatable:

DIM hConnection AS Connection
hConnection = NEW Connection ( ) 

Identifiers

Properties Methods
  1. REDIRECT Template:fmt/arg/opt ) AS Result
  • Exec( Request AS String, Arguments AS [ <, ...> ] ) AS Result
  • Find( Table AS String [ <, Request AS String, Arguments AS , ...> ] ) AS Result
  • Open() AS Boolean
  • Quote( Name AS String ) AS String
  • Rollback()