$doctitle = "Hiding the Database Login"; $authname = 'Lance Leonard'; $attrinfo = ""; $audience = "2"; $versions = "Applies to: Paradox 5.0 and later."; $postdate = "23 February 2004"; $pagearea = 2; $navlinks = 'Paradox:'; $metakeys = "paradox for windows, corel paradox, borland paradox, paradox, pdoxwin, database, aliases, alias, remote, client/server, open, opening, automatically, manually, database login dialog box, database login, login, hiding, suppressing, hide, suppress, connection, connections, alias manager"; $metadesc = "Shows how to hide the Database Login dialog when using Paradox to connect to remote servers."; ?> include( $DOCUMENT_ROOT . "/lib/pageinit.php" ); ?>
Answer: Yes, connect your database alias to the remote server before opening your forms. Use the Alias Manager to do this interactively or an ObjectPAL Database variable to do it automatically.
This article demonstrates both techniques and provides an important caution for those working with sensitive data.
Note: The samples in this article use the sample :IBLocal: alias installed with Borland's Local InterBase. The techniques, however, work with most remote servers Paradox (or BDE) can work with.
Use the Alias Manager to open database connections interactively. For example, to open the sample IBLocal alias:
From the main Paradox menu, choose Tools | Alias Manager.
Choose IBLocal from the Database alias list.
By default, the Interbase administrator user is SYSDBA. If you've changed this, enter the new administrator user name.
Enter masterkey (or the current password) as the password.
Click the connect button and wait for Paradox to connect to Local InterBase.
When Paradox connects, click OK to close the Alias Manager.
Paradox now uses the open connection for all requests to the Local InterBase server.
To open remote connections automatically, add the database user's password to the alias parameters and then use a Database variable to open the connection. The following script shows how to do this.
method run(var eventInfo Event)
var
db Database
dat DynArray[] AnyType
frm Form
endVar
dat[ "PASSWORD" ] = "masterkey"
if not db.open( "iblocal", dat ) then
errorShow( "Can't Open Database",
"Click >> button for details." )
else
frm.open( "ibcustomer" )
endIf
endMethodConnections must be opened before documents (forms and reports) using those connections. Paradox accesses remote connections to verify the integrity of a document's data model. For best results, use scripts or utility forms to open connections and documents.
Use care when including passwords in ObjectPAL. String constants, such as the password in the earlier sample script, are stored as plain text in all Paradox documents, even delivered ones. If someone knows your document contains a password, they may be able to determine your password simply by opening your document in a text editor, such as Notepad.
include( $DOCUMENT_ROOT . "/lib/pagecomp.php" ); ?>