This page contains technical detail about a system interface component. It is not required for normal day to day operation of the system.
This dll maintains the links to the underlying database and has the ability to disconnect silently from the database when not being used. This is useful where systems are left running but idle, such as leaving machines running overnight. With the automatic disconnect feature, this dll detects that it has not processed any requests recently and disconnects from the database. It automatically re-attaches when systems start using the database again. All this is achieved without the layers above being aware of the disconnect.
"seconds" is the number of seconds with no database requests required before the system will disconnect. For example
disconnect=1800 will wait for a period of 30 minutes before disconnecting. Using too small a value may cause
problems, as the time to re-attach can be measured in seconds sometimes.
Version 1.0-29.37 introduced a feature to allow operators to repair most types of corrupt databases themselves. Corrupt databases should be rare, but this option allows faster problem repair at counters.
When a corrupt database is detected the logic is:
Version 1.0-29.37 added automatic backups to the database. The intention of these backups is to provide some sort of chance to handle catastrophic failure. This is not a replacement for normal backup systems
The parameter AutoBackup is a bitmask. Bit 1 is set to have the autobackup under the folder containing the database. Bit 2 is set to have the autobackup under the current working folder. The default value is "3" to enable both backups. Bit 16 is used to indicate overnight mode.
From version P59, you can specify the AutoBackup flags as keywords rather than numbers
Copies the database once each night into a subdirectory of the database folder. This method does not create a copy on a second machine so you are still vunerable if the computer fails
Copies the database reasonably often to a subdirectory of the database folder and also to a subdirectory of the current working folder
dbcdao:AutoBackup=iflocal ifremote overnight
Copies the database once each night to a subdirectory of the database folder and also to a subdirectory of the current working folder
Version 1.0-29.58 added automatic compression of Access databases. This enables the database layer to automatically compress the Access database when it determines it is needed. The Point of Sale continues to monitor and report large databases as well, but with this feature enabled the POS messages should be very infrequent.
Automatic compression is enabled with the following line in fpos.ctl or fpos_all.ctl
dbcdao:autocompress=Nwhere N has the following meaning:
A normal retailer who typically powers off the counters overnight would use a value of 3. This means the system will attempt to compress the database every few days, and can compress during the day if the system has been idle for several minutes.
A retailer who has enterprise tools and checking might wish to set this parameter to 5. This means the system will compress during the day, but only if the database gets large, which would indicate failure or problems in the external scripts
If the system detects the POS is running for longer than 24 hours, it will automatically schedule all compressions overnight. If a compression is performed during the day, there may be a brief pause/hang if you attempt to use the POS while the compression is in progress. A typical compression takes 30 seconds and only happens every few days, and after the POS has been idle for several minutes, so overall the probability of a brief hang is low
AutoCompress has no effect if the underlying database is not Access
With version 1.0-27.1 this DLL offers a number of API functions that can be invoked directly. These allow you to connect to databases and interact with data in bulk. Each of the APIs are designed to be called from rundll32 or similar program.
The Dump API allows you to extract a single table or all tables from the database.Example:
rundll32 dbcdao2000.dll,DumpAPI database.mdb,products,products.dumpor
rundll32 dbcdao2000.dll,DumpAPI database.mdb,*,all.dumpor
rundll32 dbcdao2000.dll,DumpAPI "ODBC;dsn=sqlbox;database=finance",*,all.dump
The Debug API dumps static information about the database. This option was first available in P29 of the DLL.Examples:
Display static information about the database, specifically internal database format
rundll32 dbcdao2000.dll,DebugAPI info New.mdb
Change a field definition to AllowZeroLength. Requires version P45 or higher
rundll32 dbcdao2000.dll,DebugAPI 121010 theDatabase.mdb,f602(83) f603(TableName) f607(FieldName)
The Build API uses a dump file to create a copy of the original database or table. Copies are designed for support and testing purposes rather than being instantly production ready. For example, indexes in the original source database may not be preservedExample:
rundll32 dbcdao2000.dll,BuildAPI New.mdb,all.dump
The Load API allows you to insert rows into table or tables from a file created by the Dump API. Typically used in a distributed system to bulk load and replicate data to remote databases.
|db(N)||Specifies the destination database|
|file(N)||Sets the input file containing the source records to be loaded|
|table(N)||Sets the output table. This parameter is optional and if not given all tables in the input file will be loaded to the original table names they were extracted from.|
|key(N)||Defines the primary key for the table. If not provided the system will attempt
to determine this information from the database indexes present.|
Key information is not required if mode(reset) is used
|delete(N)||Control whether the input file is deleted after processing is completed. Use '1' to delete the file or '0' to keep the file. The default is to delete the input file|
|mode(N)||Sets how records are to be merged into the target table.
rundll32 dbcdao2000.dll,LoadAPI db(New.mdb) file(products.dump) table(products)
Not currently documented for external use.