This function is used to sign on to a database. It is mainly used when running Batch Queries – you must Connect to a database before any queries can be run. However this function can also be used when you are in "normal" (interactive) AQT – you can use this to sign onto a number of databases without going through the normal signon dialogs.
The Connect
function takes the following parameters. Most of these correspond to parameters specified on the Signon window.
Parameter |
Description |
Mandatory? |
Notes |
|
Specifies a full connection string |
N |
If this option is specified, no other option is needed except Dbs. This is a technical parameter and should only be used by those familiar with database connection strings. |
|
The name of the database you wish to connect to. |
|
This is the same as the database name you would use in the Signon window. If you have specified Conn, the Dbs parameter has a slightly different meaning. It will be used as (an arbitrary) name you give this database (you may need to refer to this database if you code a use function). |
|
UserID to sign on with. |
N |
If not specified, you will be signed on without a userID or password. |
|
Password to sign on with. |
N |
This password is specified in clear text. This is a security exposure - it is preferable to use the If |
|
Encrypted Password. |
|
AQT provides a facility for generating encrypted passwords for use in the |
|
The name of the SQL Server / Sybase / Informix database to sign onto. |
|
This is the same as option Database Name in the signon window. |
|
Specifies the level of prompting you wish for the signon |
|
Values are:
This parameter is ignored if you are running AQT in batch mode. |
|
Specifies the name of the Excel Worksheet to be written to |
|
This is used for Excel only. If you code This parameter is optional – if not coded, a new Worksheet is always created (and |
|
|
N |
Used only for Excel, and only if AQT supports appending data to worksheets. Use |
|
Specifies whether you are signing on with sysoper or sysdba privileges. |
|
Only used when signing onto Oracle. Requires Oracle ODBC Driver v9.2 or above. |
Examples:
--aqt connect,dbs=sample
--aqt connect,dbs=ora_sample,user=system,epwd=JkAlDkEEkGg,connectas=sysdba
--aqt connect,conn="Driver={Microsoft Access Driver (*.mdb)};Dbq=c:\aqtdemo.mdb",dbs=Access