Database
|
Purpose: |
Open a database using a file name or server connection string. A connection string should include a provider, data source, user name, password, etc. as required by server. See Opening a Database for more information. |
|
Category: |
Database |
|
Syntax: |
dbpOpenDatabase "database id" "file name or connection string" database id A name that you want to use to refer to this database in the future. file name or connection string The type of database you're using dictates whether you can use a simple file name or connection string here. See Opening a Database for more information. |
|
Example: |
The following example opens a dBase format file called Sample.dbf: dbpOpenDatabase "DB1" "[PubDir]Sample.dbf" Here we use a connection string to open a MySQL database: dbpOpenDatabase "MySQL" "Provider=MSDASQL.1;Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=test;User=root;Password=apple;Option=3" Here is a connection string to open a SQLite database: dbpOpenDatabase "SQLite" "Provider=MSDASQL.1;Driver=SQLite3 ODBC Driver;Database=C:\Program Files\SQLite ODBC Driver\test.db" Note: SQLite requires that you have a compatible ODBC driver installed on your PC. If you don't have a SQLite ODBC driver, you can find one at the following web site: http://www.ch-werner.de/sqliteodbc/ |
|
SQL Equivalent: |
USE database |
|
Purpose: |
Open a Microsoft Access (MDB or ACCDB) format database file. To open other types of databases use dbpOpenDatabase instead. See Opening a Database for more information. |
||||||||
|
Category: |
Database |
||||||||
|
Syntax: |
dbpOpenAccessDatabase "database id" "file name" "options" database id A name that you want to use to refer to this database in the future. file name The database file name. options This is a compound parameter and can contain any combination of the following items:
Separate multiple items in a compound variable with semicolons (;). This parameter may be left blank if none of the options are required. |
||||||||
|
Example: |
dbpOpenAccessDatabase "DB1" "[PubDir]AddressBook.mdb" "password=kitty123" |
||||||||
|
SQL Equivalent: |
N/A |
|
Purpose: |
Create a new Microsoft Access (MDB or ACCDB) format database file. This action only creates the database - it does not open it. You must use dbpOpenAccessDatabase to open the database for editing. |
||||
|
Category: |
Database |
||||
|
Syntax: |
dbpCreateAccessDatabase "file name" "options" file name The database file name. options This is a compound parameter and can contain any combination of the following items:
Separate multiple items in a compound variable with semicolons (;). This parameter may be left blank if a password and encryption are not desired. |
||||
|
Example: |
dbpCreateAccessDatabase "[PubDir]AddressBook.mdb" "Password=kitty123;Encrypted=Yes" To create unprotected, unencrypted database you can simply leave the options parameter blank: dbpCreateAccessDatabase "[PubDir]AddressBook.mdb" "" |
||||
|
SQL Equivalent: |
N/A |
|
Purpose: |
Compress a Microsoft Access (MDB or ACCDB) format database file and remove space occupied by deleted records. When records are deleted using dbpDeleteRecord, the physical size of the database file does not necessarily decrease. Instead the database may simply mark the record as deleted, but the space occupied by the record remains in the file. dbpCompactAccessDatabase removes any records marked as deleted and reduces the size of the database file. |
||||
|
Category: |
Database |
||||
|
Syntax: |
dbpCompactAccessDatabase "file name" "password" file name The database file name. options This is a compound parameter and can contain any combination of the following items:
Separate multiple items in a compound variable with semicolons (;). This parameter may be left blank if a password and encryption are not required. |
||||
|
Example: |
dbpCompactAccessDatabase "[PubDir]AddressBook.mdb" "" |
||||
|
SQL Equivalent: |
N/A |
|
Purpose: |
Close a database previously opened with dbpOpenDatabase or dbpOpenAccessDatabase. Calling dbpCloseDatabase is optional since any databases or tables that are open when a publication is shutdown will automatically be closed. |
|
Category: |
Database |
|
Syntax: |
dbpCloseDatabase "database id" database id The name assigned to the database you want to close. |
|
Example: |
dbpCloseDatabase "DB1" |
|
SQL Equivalent: |
N/A |