hk_connection

hk_connection connects to the SQL Server. The most important functions are set_host(), set_user(), set_password() and connect().

Inherits from hk_class.

set_host(hostname)

sets the host name or host IP number

host()

returns the host name

set_user(username )

sets the user name used on the host

user()

returns the user name

set_password(password)

sets the password for the user

set_tcp_port(port)

sets the TCP port

tcp_port()

returns the TCP port

default_tcp_port()

returns the default TCP port for this database server

connect([interactive])

connects to the server using the user, host and TCP data. Returns True if connecting was successful, else False.

Parameter 'interactive': if set to interactive and the connection fails, a login dialog appears. Possible values

  • hk_class.noninteractive

  • hk_class.interactive

disconnect()

disconnects from the server

is_connected()

returns true if this connection is connected to the server

dblist()

returns a list of all existing databases in this connection

new_database([name])

creates a new hk_database object

delete_database(databasename)

deletes an exisiting database

database_exists(databasename)

returns true if the database "databasename" exists

mimetype()

returns the mimetype of a local database format, if it is not a local database format it returns an empty string