• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
      • CSPro DB
      • Encrypted CSPro DB
      • Text
      • JSON
      • None
      • In-Memory
      • Comma Delimited (CSV)
      • Semicolon Delimited
      • Tab Delimited
      • Excel
      • R
      • SAS
      • SPSS
      • Stata
      • CSPro Export
      • Case Read Optimization
    • 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>

CSPro DB Data Source

Overview
The CSPro DB data source allows reading and writing data to a SQLite database. This data source, introduced in CSPro 7.0, is the default data source for collecting data, and is the most used CSPro data source, followed by text files. Unless there is a requirement that your data be in text format, you are encouraged to use the CSPro DB data source, as it has the most functionality of all data sources.
The structure of the SQLite database is based on the dictionary. Each record in the dictionary corresponds to a table in the database. The database tables have the same name as the record in the dictionary. Each item in the record corresponds to a column in the table with the same name as the dictionary item. Because the CSPro DB data source is a SQLite database, it is possible to query the data using SQL statements.
The CSPro DB data source is used when a file has the extension .csdb. An encrypted version of this data source, Encrypted CSPro DB, is used if a file has the extension .csdbe.
Functionality
The CSPro DB data source supports the following features:
FeatureSupported
Reading cases
✔
Writing cases
✔
Notes, case labels, and case statuses
✔
Storage of more than one kind of record
✔
Binary data items
✔
Deleting cases
✔
Undeleting cases
✔
Syncing data
✔
Cases with duplicate keys
✔
Case identification via UUID
✔
Contains an embedded dictionary
✔
Allows record sorts
✘
Binary Data
The CSPro DB data source stores binary data as blobs in a binary-data table. When reading case data, binary data is loaded asynchronously, read from the SQLite database only when needed by the application.
Customizable Behavior
The following behavior can be customized by specifying properties in the connection string. The default behavior is marked with ⁺⁺⁺.
Property Name and ValuesDescription
 
"cache"Determines if cases are cached in memory. This may be useful to advanced users who want to optimize programs that do a lot of case lookups.
true
Cases are cached, meaning that a case is only read from the data source once.
false ⁺⁺⁺
Cases are not cached.
For example, the following connection string, specified in a data entry PFF, would attach to an external dictionary a CSPro DB file with caching enabled:
CENSUS_2024_DICT=.\Census.csdb|cache=true
See also: Data Sources, CSPro DB File Format, Encrypted CSPro DB Data Source