Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » UltraLite - Database Management and Reference » Using UltraLite Databases » Connecting to an UltraLite database » Opening UltraLite connections with connection strings » Assembling parameters into UltraLite connection strings

 

Specifying file paths in an UltraLite connection parameter

The physical storage of your device determines:

The DBF parameter is most appropriate when targeting a single deployment platform or when using UltraLite desktop administration tools. For example:

ulload -c DBF=sample.udb sample.xml
Windows Mobile tip

You can use the UltraLite administration tools to administer databases already deployed to an attached device. See Windows Mobile.

Otherwise, if you are writing a cross-platform application, use the platform specific (CE_FILE, NT_FILE, or PALM_FILE) file connection parameters to construct a universal connection string. For example:

Connection = DatabaseMgr.OpenConnection("UID=JDoe;PWD=ULdb;
CE_FILE=\database\MyCEDB.udb;PALM_FILE=MyPalmDB")
Windows desktop

Desktops allow either absolute or relative paths.

Windows Mobile

Windows Mobile devices require that all paths be absolute.

You can administer a Windows Mobile database on either the desktop or the attached device. To administer a database on a Windows Mobile device, ensure you prefix the absolute path with wce:\. For example, using the ulunload utility:

ulunload -c DBF=wce:\UltraLite\myULdb.udb c:\out\ce.xml

In this example, UltraLite unloads the database from the Windows Mobile device to the ce.xml file in the Windows desktop folder of c:\out.

If you are using the ulunloadold or ulunload utilities to administer a database on the Windows Mobile device directly, UltraLite cannot back up the database before the unload or action occurs. You must perform this action manually before running these utilities.

Palm OS

Palm OS does not necessarily use the concept of file paths. Therefore, how you define it depends on the store type (that is, record-based, or VFS).

File-based stores (VFS)   For databases on a VFS volume, define the file with the following syntax:

vfs: [ volume-label: | volume-ordinal: ] filename

You can set the volume-label as INTERNAL for the built-in drive, or CARD for either an expansion card or the label name of the volume. There is no default string for the volume-label.

Alternatively, you can set the volume-ordinal to identify the volume. Since the enumeration of mounted volumes can vary, ensure that you set the correct ordinal volume for your chosen internal or external volume. The default value is 0 (which is the first volume enumerated by the platform).

For the filename, always specify the absolute file path, following the file and path naming convention of Palm OS. If directories specified in the path do not already exist, they are created.

Record-based data stores   For record-based data stores, database names must follow all conventions for Palm OS database names. For example, database names cannot exceed the 32 character limit and cannot contain a path.

Also ensure that you use the appropriate value for DBF or PALM_FILE according to the database's location.

  • Use the .pdb extension with DBF when you store a Palm OS database anywhere other than on the device itself (for example, with ulload).
  • Once you move the file to the device, the .pdb extension is dropped by the HotSync conduit. For example, if the database you created on the desktop is named CustDB.pdb, then when you deploy it to the device, the filename changes to CustDB.
Note

You cannot deploy databases to VFS volumes using the Palm install tool. Instead, you need to copy the database directly onto the media with a card reader, or some other tool.

See also