Specifies the parameters required to connect to a database.
ODBC
UL9 UltraLite 9
UL10 UltraLite 10
The ConnectString syntax displays on a single line. You must enclose the entire ConnectString in single quotes and separate parameters within the ConnectString with semicolons.
ConnectString = ‘DSN = data_source_name; {UID = user_ID; PWD = password; driver_specific_parameters}’
Parameter |
Description |
---|---|
data_source_name |
A name that identifies the data source |
user_ID |
(Optional) The user ID required to connect to the data source |
password |
(Optional) The password required by user_ID to connect to the data source |
driver_specific_parameters |
(Optional) Any other driver-specific parameters required to connect |
ConnectString = ‘DBF = database_file_name;UID = user_ID; PWD = password{; driver_specific_parameters}’
Parameter |
Description |
---|---|
database_file_name |
A name that identifies the database file. |
user_ID |
The user ID required to connect to the database. |
password |
The password required by user_ID to connect to the database. |
driver_specific_parameters |
(Optional) Any other driver-specific parameters required to connect. Do not supply quotes in this string. |
None
For ODBC, PocketBuilder generates the ConnectString automatically when you define an ODBC data source and copies it to the DBParm box in the Database Profile Setup dialog box. This happens before you connect to the data source in PocketBuilder.
Therefore, you do not have to enter the ConnectString yourself when defining an ODBC data source. However, you might need to edit the ConnectString value in the Database Profile Setup dialog box.
You can change the ConnectString parameter if necessary by editing it in the Database Profile Setup dialog box. For example, if you change the name of an existing ODBC data source, edit its database profile to update the connect string with the new DSN (data source name) value.
For UltraLite, you can use the Browse button to locate the UDB file on your file system.
This example shows a connect string for an ODBC data source that contains the data source name (DSN=Sales), user ID (UID=dba), and password (PWD=sql). Parameters within the connect string are separated by semicolons.
Database profile On the Connection tab in the Database Profile Setup dialog
box, select Sales from the Data Source drop-down list, select the User
ID check box and type dba
,
and select the Password check box and type sql
.
PocketBuilder application script Type the following in a PocketBuilder application script:
SQLCA.dbParm = "ConnectString ='DSN=Sales;UID=dba;PWD=sql'"
This example shows a connect string for an UltraLite database that contains the database file name, user ID, and password, and two additional ConnectString parameters. Parameters within the connect string are separated by semicolons.
Database profile On the Connection tab in the Database Profile Setup dialog
box, click the Browse button to navigate to the location of the database
file, select the User ID check box and type dba
,
select the Password check box and type sql
,
and type key=r2viklj;cp=cs1250
in the
Additional ConnectString Parameters box.
PocketBuilder application script Type the following in a PocketBuilder application script:
SQLCA.dbParm= "ConnectString='DBF=C:\uleq.udb;UID=dba;PWD=sql;key=r2viklj;cp=cs1250'"