adbsql(n) 1.0 "Tcl SQL connectivity"
adbsql - MySQL connectivity for ADB Tcl database implementation
package require Tcl 8
package require mysqltcl
This package provides connectivity of an ADB database to a MySQL
database. By using adbsql in combination with adb and a MySQL
database, your data is always safely stored in a database, even if you
did not save it to a file.
This package uses the mysqltcl package that should be installed.
- ADBSQL::Connect ?-port portno? ?-host host? ?-user username? ?-password password? ?-database database? ?-new YesOrNo?
-
Connect and make use of a MySQL database, instead of storing the records internally. When this call is successful, all calls to ADB functions that modify the database are automatically passed on to calls to change this MySQL database.
This function returns TRUE (1) if succesfull or FALSE (0) if an error
occurred. In case of an error, use ADBSQL::ErrorMessage to get
the error message string.
Example:
| set result [DBSQL::Connect \
-port 3306 \
-host 127.0.0.1 \
-user myuser \
-password topsecret \
-database adbexample \
-new 1]
if { $result == 0 } {
tk_dialog .hi "Error" \
"Cannot open database. Error message: [DBSQL::ErrorMessage]" \
error {} Ok
return
}
|
- ADBSQL::Disconnect
-
Disconnect from a previously connected database. After a disconnect, the internal database of ADB itself is used again. Note that this internal database is Not automatically filled!
- ADBSQL::ErrorMessage
-
Return the last known error string. This function can be called if one of the other functions returns a FALSE (0) value.
- ADBSQL::InUse
-
This function returns if the MySQL database is used. The return value is a boolean and TRUE or 1 indicates that a MySQL database is indeed used.
adb, database, mysql, mysqltcl, sql, tcl
Copyright © Roalt Aalmoes, 2007