dbpAddRecord

Purpose:

Add a new empty record to a table.

Category:

Add/Modify

Syntax:

dbpAddRecord "database id" "table"

database id

The name assigned to the database.

table

The name of the table where the record will be added.

Example:

dbpAddRecord "AddrBook" "Contacts"

SQL Equivalent:


INSERT INTO table (fields) VALUES(data)


dbpDeleteRecord

Purpose:

Delete the current record.

Category:

Add/Modify

Syntax:

dbpDeleteRecord "database id" "table"

database id

The name assigned to the database.

table

The name of the table containing the record to delete.

Example:

dbpDeleteRecord "AddrBook" "Contacts"

SQL Equivalent:


DELETE FROM Table WHERE filter*


*Deleting records with SQL requires that the target record(s) be identified using a query filter. To delete a single record, you much construct the filter so that the only matching record is the one you want to delete.


dbpDeleteAll

Purpose:

Delete all records matching current search query (see dbpQuery). If no query is active, the entire table will be deleted. Use this action with caution - there is no way to restore deleted records!

Category:

Add/Modify

Syntax:

dbpDeleteAll "database id" "table"

database id

The name assigned to the database.

table

The name of the table containing the records to delete.

Example:

dbpQuery "DB1" "Vendors" "AccountStatus = [#34]Paid[#34]"

If "[DB1.Vendors.$RecCount]" "=" "0"

  AlertBox "Sorry" "No records found."

Else

  MessageBox "Delete" "Delete all found records?" "Yes?No" "[Result]"

  If "[Result]" "=" "1"

    dbpDeleteAll "DB1" "Vendors"

  EndIf

EndIf

dbpShowAll "DB1" "Vendors"

SQL Equivalent:


DELETE FROM table


dbpEmptyTable

Purpose:

Remove all records from a table. This does the same thing as dbpDeleteAll except on some databases this action will execute faster. Use this action with caution - there is no way to restore deleted records!

Category:

Add/Modify

Syntax:

dbpEmptyTable "database id" "table"

database id

The name assigned to the database.

table

The name of the table to be emptied.

Example:

dbpEmptyTable "AddrBook" "Contacts"

SQL Equivalent:


TRUNCATE table


dbpStrReplace

Purpose:

Replace all occurrences of a string in a single field. If a query is active, only records matching the search criteria will be copied. You can use this action to perform a search and replace across an entire table.

Category:

Add/Modify

Syntax:

dbpStrReplace "database id" "table" "field" "sourcestr" "replacestr"

database id

The name assigned to the database.

table

The name of the table.

field

The name of the field to search.

sourcestr

The text to be replaced.

replacestr

The replacement text.

Example:

dbpStrReplace "AddrBook" "Contacts" "Telephone" "(503)" "(541)"

SQL Equivalent:

The following replaces all occurrences of "Athens" with "Paris" in the Contact table's City field:


UPDATE Contacts SET City="Paris" where City="Athens"


dbpRefresh

Purpose:

Reload the latest table data from the database. Use with multi-user databases to retrieve updates made by other users.

Category:

Add/Modify

Syntax:

dbpRefresh "database id" "table"

database id

The name assigned to the database.

table

The name of the table to be refreshed.

Example:

dbpRefresh "AddrBook" "Contacts"

SQL Equivalent:


N/A