• <GetStart>
  • CSPro User's Guide
    • The CSPro System
      • What is CSPro?
      • CSPro Capabilities
      • Release History
      • What's New in CSPro?
      • CSPro Applications
      • CSPro General Concepts
      • CSPro General Functionality
        • Data Sources
        • Connection String
        • Encrypted Data
        • Unicode Primer
        • Synchronization Overview
        • Paradata
        • Multiple Language Applications
        • Mapping
        • Questionnaire View
      • How To ...
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Templated Reporting System
    • HTML and JavaScript Integration
    • Action Invoker
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataViewer>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

Connection String

A connection string is a text string that details how to open a data source. Typically a connection string is just a file name. Connection strings are used in PFF files as well as in logic when data sources are specified, such as when using the setfile function. A connection string is made up of several components:
file_name | property_name1=property_value1 & property_name2=property_value2
The file_name argument is the file name of the data source. It can be specified as a relative or absolute path. If only the file name is specified, then the connection string is complete. However, if any properties are specified, then the properties must be separated from the file name by a pipe '|' character.
Multiple properties can be specified, with each grouping separated by the ampersand '&' character. The property name is listed, followed by an equals '=' sign, and then the property value is given. Most property values can be defined in human-readable text, but if the value contains special characters such as '&' or '=' characters, it must be percent-encoded, which you can do using the String Encoder.
The property "type" is used by CSPro to specify the type of a data file. Generally this is not necessary to define because the data file type can be deduced from the file extension, but in a couple cases it is necessary. This, for example, is how the None data source is specified in a PFF:
InputData=|type=None
Other properties are documented in the topics describing the data sources. An example of one property is the "password" property for Encrypted CSPro DB data sources. It can be specified in logic:
string pin_number = prompt("Enter your PIN number:", password, numeric);

setfile(HOUSEHOLD_DICT, "Household.csdbe|password=" + pin_number);
Or specified for the PFF:
See also: Data Sources