ConnectEstablish a connection to a database, file, or native type Connect creates (or reinitializes) the variable passed to it as the first parameter as a data connection to the specified source (second parameter) using the protocol specified in the third parameter. An optional fourth parameter "Manual Transactions" is supported by the ODBC protocol which will set the connection to transaction mode allowing you to rollback and/or commit the transaction.
Supported protocols include:
TAB -- Tab delimited text file
ODBC -- ODBC data source (User/UID/Password parameters may be included as supported by your data source)
ODBC With ManualTransactions -- ODBC data source with manual transactions enabled
CSV -- Comma seperated text file
PSV -- Pipe seperated text file
TEXT -- Plain text file
Sample SourceIf ( Connect MyDatabase to "DSN=sample" as ODBC ) Then
Say "Connected"
Disconnect MyDatabase
Else
Say "Could not connect! "
Say GetLastError MyDatabase
Endif
|
Sample SourceIf ( Connect MyDatabase to "DSN=sample" as ODBC with ManualTransactions) Then
Say "Connected"
Disconnect MyDatabase
Else
Say "Could not connect! "
Say GetLastError MyDatabase
Endif
|
Sample SourceIf ( Connect MyDatabase to "FILE=sample.csv;QUOTEDTEXT=Y;READONLY=Y" as CSV) Then
Say "Connected"
Disconnect MyDatabase
Else
Say "Could not connect! "
Say GetLastError MyDatabase
Endif
|
Related Function(s): Disconnect; Minimum version: 1.0
|