DB.CreateConnection |
Top Previous Next |
Syntax function DB.CreateConnection(ConType: integer; ConParams: string): pointer
Alternative Names
Description Create a new Connection object and returns a pointer to it that can be used in additional routine calls. If connection failed, NULL is returned.
ConType is one of the following constants:
ConParams depends on the database connection type and is a combination of name=value pairs.
ODBCdatabase|dbname=(database);[username=(username)];[password=(password)]
Database should be the name of an ODBC data source.
Username and password are optional, depending on the data source.
ADOdatabase|dbname=(connectstring)
Database should be the complete connect string.
Firebird/InterBasedatabase|dbname=(database);[username=(username)];[password=(password)][clientlib=(path_to_clientlib)][names=(charset_name)][sqldialect=1|3]
Database is a connection string with server, optional port, and database path. Additional options are available.
MySQLdatabase|dbname=(database);[username=(username)];[password=(password)]
Database is a server:database name.
See Also
Example execute udsblock as begin connectstr = 'database=server_fb:c:\data\testdb.fdb;username=SYSDBA;password=masterkey; client_library=C:\Program Files (x86)\Firebird\Firebird_4_0\fbclient.dll';
FBCon = DB.CreateConnection(__ctFirebird, connectstr);
DB.UseConnection(FBCon); try /* perform queries */ finally DB.CloseConnection(FBCon); end end |