comp • gb.db • connection • _new

New _Connection (gb.db)

Dim hConnection As _Connection
hConnection = New _Connection ( )

Creates a new connection object.

The format of optional DatabaseURL parameter is: $TYPE://[[email protected]]$HOST[:$PORT]/$NAME where the $USER and $PORT parts are optional. If this parameter is given and valid, the Connection properties are filled with the information.

Examples

' Create a MySQL connection
$hConn = New Connection("mysql://[email protected]:3306/testdb")
' Don't forget to set $hConn.Password if need be
' Create a SQLite3 connection, use $HOME/db.sqlite as database
$hConn = New Connection("sqlite3://" & User.Home &/ "db.sqlite")