A5Storage::DataContainer::ShowConnectionStringDialog Method

Syntax

A5Storage::DataContainer::ShowConnectionStringDialog as A5Storage::CallResult (BYREF ConnectionStringResult as C, ConnectionStringIn as C [, EncryptResponse as L [, Passphrase as C]])

Arguments

BYREF ConnectionStringResultCharacter

The resulting connection string creted using the dialog.

ConnectionStringInCharacter

A connection string used to populate the dialog. Can be a blank string, IE "".

EncryptResponseLogical

Defines the initial value of the Encrypt Connection String checkbox.

PassphraseCharacter

Used to decrypt an encrypted connection string, if ConnectionStringIn was previously encrypted.

Returns

ResultA5Storage::CallResult

Information about whether or not the operation succeed. Result.Success with be .T. if the operation succeeds, otherwise .F.

Description

Displays the Storage Connection String dialog. Returns a connection string in either clear text or encrypted if the connection string was encrypted in the dialog.

Discussion

This function displays a connection string dialog and returns a clear text or encrypted password. The function returns a call result which indicates whether the dialog was exited by clicking OK or Cancel, or if an error occurred in decrypting/encrypting the connection string.

The EncryptResponse parameter is used to set the initial value of the Encrypt Connection String checkbox.

The Passphrase parameter is used to decrypt the connection string (if it is encrypted). If the decryption succeeds, the value is used to set the initial value of the Encryption Passphrase text box. If the decryption fails (or a passphrase is not provided), a dialog prompts the user for a passphrase until they either enter the correct one, or they click the Cancel button.

The user can check or uncheck the Encrypt Connection String checkbox or the text value of Encryption Passphrase before returning from the dialog. If the checkbox is set and OK is clicked, the connection string is encrypted using the current value of the Encryption Passphrase text box.

Example

dim ConnectionString as C
dim CR as CallResult
CR = A5Storage::DataContainer::ShowConnectionStringDialog(ConnectionString, ConnectionString, .t., "mysecret")