iAnywhere.Data.UltraLite namespace
UL Ext.: Builds a connection string for opening a connection to an UltraLite database. The frequently-used connection parameters are individual properties on the ULConnectionParms object.
' Visual Basic
Public Class ULConnectionParms
Inherits Component
// C#
public class ULConnectionParms :
Component
A ULConnectionParms object is used to specify the parameters for opening a connection (Open method), creating a database (OpenWithCreate method), dropping a database (DropDatabase method), or specifying a schema file (ApplyFile method).
Leading and trailing spaces are ignored and values must not contain semicolons (;), parentheses (), or curly braces {}. For future compatibility it is strongly recommended that values do not contain single (') or double (") quotes.
When building a connection string, you need to identify the database, specify any optional connection settings, and specify the database schema file if you wish to create the database with OpenWithCreate method. Once you have supplied all the connection parameters by setting the appropriate properties on a ULConnectionParms object, you create a connection string using the ToString method method. The resulting string is used to create a new ULConnection class with the ULConnection constructor constructor or set the ConnectionString property property of an existing ULConnection class object.
Identifying the database
Each instance contains platform-specific paths to the database. Only the value corresponding to the executing platform is used. For example, in the code below the path \UltraLite\mydb1.udb would be used on Windows CE, while mydb2.db would be used on other platforms.
' Visual Basic Dim dbName As ULConnectionParms = new ULConnectionParms dbName.DatabaseOnCE = "\UltraLite\mydb1.udb" dbName.DatabaseOnDesktop = "mydb2.udb" // C# ULConnectionParms dbName = new ULConnectionParms(); dbName.DatabaseOnCE = "\\UltraLite\\mydb1.udb"; dbName.DatabaseOnDesktop = "mydb2.udb";
The recommended extension for UltraLite database files is .udb. On Windows CE devices, the default database is \UltraLiteDB\ulstore.udb. On other Windows platforms, the default database is ulstore.udb. In C#, you must escape any backslash characters in paths or use @-quoted string literals.
If you are using multiple databases, you should specify a database name for each database. See the AdditionalParms property property for more information.
Optional connection settings
Depending on your application's needs and how the database was created, you may need to supply a non-default UserID property and Password property, a database EncryptionKey property, and the connection CacheSize property. If your application is using multiple connections, you should provide a unique ConnectionName property for each connection.
Databases are created with a single authenticated user, DBA, whose initial password is SQL. By default, connections are opened using the user ID DBA and password SQL. To disable the default user, use the RevokeConnectFrom method method. To add a user or change a user's password, use the GrantConnectTo method method.
If an encryption key was supplied when the database was created, all subsequent connections to the database must use the same encryption key. To change a database's encryption key, use the ChangeEncryptionKey method method.
Identifying the schema
When creating a database, you must supply a schema. The path to the schema file is specified using the platform-specific properties SchemaOnCE property and SchemaOnDesktop property. Only the value corresponding to the executing platform is used.
For more information, see Connection Parameters.
ULConnectionParms members
ULConnectionParms constructor
AdditionalParms property
CacheSize property
ConnectionName property
DatabaseOnCE property
DatabaseOnDesktop property
EncryptionKey property
Password property
SchemaOnCE property
SchemaOnDesktop property
UserID property
ToString method
UnusedEvent event
SQL Anywhere Studio 9.0.2
Copyright © 1989–2004 Sybase, Inc. Portions copyright © 2001–2004 iAnywhere Solutions, Inc. All rights reserved.