dbpImportFromCSV

Purpose:

Import records from an external delimited ASCII file. The format of the ASCII file must be compatible with the table it's being imported into. Files created with the dbpExportToCSV action can be used as well as files created by many commercial database and spreadsheet applications.

Category:

Import/Export

Syntax:

dbpImportFromCSV "database id" "table" "filename" "properties"

database id

The name assigned to the database containing the table you want to import into.

table

The name of the table that will receive the imported data.

filename

The name and location of the external file containing the data to be imported.

properties

This is a compound parameter and can contain any combination of the following items:


Delimiter=char

The delimiter character used to separate field data in the file. You must specify the correct delimiter or the file will not import properly. The most common delimiter character is a comma (,).

IncludesFieldNames=Yes/No

Yes = The first line in the file contains field names. No = the first line in the file contains data.

MatchFieldNames=Yes/No

Yes = if possible match the file's field names to the table's field names when importing data. No = ignore the file's field names and import field data into the table in the order it appears.


Separate multiple items in a compound variable with semicolons (;).

Example:

dbpImportFromCSV "AddrBook" "Contacts" "[PubDir]data.csv" "Delimiter=,;ContainsFieldNames=Yes;MatchFieldNames=Yes"

SQL Equivalent:


LOAD DATA INFILE filename INTO TABLE table


dbpExportToCSV

Purpose:

Export all records matching current search query (see dbpQuery) to an external delimited ASCII text file. If no query is active, the entire table will be exported. Most database and spreadsheet software can import delimited ASCII files. You can modify the format of the exported file using the properties parameter. You can also use dbpSetColumnOrder to limit which fields are exported.

Category:

Import/Export

Syntax:

dbpExportToCSV "database id" "table" "filename" "properties"

database id

The name assigned to the database containing the table you want to export.

table

The name of the table to be exported.

filename

The name and location of the external file where the exported records will be written.

properties

This is a compound parameter and can contain any combination of the following items:


Range=Current/All

Use Current to export only the active record or All to export the entire table.

Delimiter=char

The delimiter character that will be used to separate field data in the file. The most common delimiter character is a comma (,).

IncludeHidden=Yes/No

Yes = export both visible and hidden fields. No = export only visible fields. Field visibility can be changed using the dbpSetColumnOrder action. By default, all fields are visible.

IncludeFieldNames=Yes/No

Yes = include the field names at the beginning of the file. No = do not include field names. Field names are used by some commercial database and spreadsheet applications when importing delimited ASCII files.

UseColumnTitles=Yes/No

For use with IncludeFieldNames property above. Yes = use column titles defined with dbpSetColumnTitles instead of field names. No = use table's actual field names.

Append=Yes/No

Yes = if the export file already exists append the new data to the end of the existing data. No = overwrite existing export file.

ForceQuotes=Yes/No

Yes = surround all field data with quote characters. No = do not use quote characters unless they are required. Normally quotes are only required when the field data contains the delimiter character.


Separate multiple items in a compound variable with semicolons (;).

Example:

dbpExportToCSV "AddrBook" "Contacts" "[PubDir]data.csv" "Range=All;Delimiter=,;IncludeHidden=No;IncludeFieldNames=Yes;Append=No; ForceQuotes=No"

SQL Equivalent:


SELECT * INTO OUTFILE filename

  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'

  LINES TERMINATED BY '\n'

  FROM table;


dbpExportToHTML

Purpose:

Export all records matching current search query (see dbpQuery) to an external HTML document file. If no query is active, the entire table will be exported. The created HTML file will contain a static version of the table at the time of export. You can modify the format of the exported file using the properties parameter. You can also use dbpSetColumnOrder to limit which fields are exported.

Category:

Import/Export

Syntax:

dbpExportToHTML "database id" "table" "filename" "properties"

database id

The name assigned to the database containing the table you want to export.

table

The name of the table to be exported.

filename

The name and location of the external HTML file where the exported records will be written.

properties

This is a compound parameter and can contain any combination of the following items:


Range=Current/All

Use Current to export only the active record or All to export the entire table.

IncludeHidden=Yes/No

Yes = export both visible and hidden fields. No = export only visible fields. Field visibility can be changed using the dbpSetColumnOrder action. By default, all fields are visible.

IncludeFieldNames=Yes/No

Yes = include the field names at the beginning of the file. No = do not include field names. Field names are used by some commercial database and spreadsheet applications when importing delimited ASCII files.

Title=value

The HTML page title.

HTMLHeader=value

A custom header to be used for the HTML document. You may optionally include the following keywords as part of the header:


#TITLE

This code will be replaced with the value assigned to the Title property above. For example:


<head>

<title><#TITLE></title>

</head>

#STYLE

This code will be replaced with a cascading style sheet (css) based on the properties assigned to the table grid using the dbpSetGridStyle action. For example, the following will generate a HTML document that closely resembles the foratting used by the table grid:


<head>

<style type=text/css>

#STYLE

</style>

</head>

HTMLFooter=value

A custom footer to be used for the HTML document.


Separate multiple items in a compound variable with semicolons (;).

Example:

SetVar "[Header]" "<html><head><title><#TITLE></title>[#13]<style type=text/css>[#13]#STYLE[#13]</style>[#13]</head><body><p><h1>VisualNEO for Windows Generated Table</h1></p>"

SetVar "[Footer]" "<br /><p>This is a footer!</p>[#13]</body></html>"

dbpExportToHTML "AddrBook" "Contacts" "[PubDir]1stQtrSales.html" "Range=All;IncludeHidden=No;IncludeFieldNames=Yes;Title=Zircon Corp. 1st Quarter Sales;HTMLHeader=[Header];HTMLFooter=[Footer]"


SQL Equivalent:


N/A


dbpExportToXML

Purpose:

Export all records matching current search query (see dbpQuery) to an external XML file. If no query is active, the entire table will be exported. Many of the newest database and spreadsheet software can import XML files. You can modify the format of the exported file using the properties parameter. You can also use dbpSetColumnOrder to limit which fields are exported.

Category:

Import/Export

Syntax:

dbpExportToXML "database id" "table" "filename" "properties"

database id

The name assigned to the database containing the table you want to export.

table

The name of the table to be exported.

filename

The name and location of the external file where the exported records will be written.

properties

This is a compound parameter and can contain any combination of the following items:


Range=Current/All

Use Current to export only the active record or All to export the entire table.

IncludeHidden=Yes/No

Yes = export both visible and hidden fields. No = export only visible fields. Field visibility can be changed using the dbpSetColumnOrder action. By default, all fields are visible.


Separate multiple items in a compound variable with semicolons (;).

Example:

dbpExportToXML "AddrBook" "Contacts" "[PubDir]data.xml" "Range=All;IncludeHidden=No"

SQL Equivalent:


N/A


dbpExportBlob

Purpose:

Export the contents of a picture/blob field from the current record to an external file. The format of the exported file will be identical to the source of the original field data.

Category:

Import/Export

Syntax:

dbpExportBlob "database id" "table" "filename"

database id

The name assigned to the database containing the table you want to export.

table

The name of the table containing the field to be exported.

filename

The name and location of the external file where the picture/blob field data will be written. If the export file already exists, it will be overwritten.


Many programs use the three letter file name extension to identify the format of a file. For example, the ".bmp" extension identifies a file as a Windows bitmap (BMP). When inserting images into a picture field, NeoDBpro will keep track of the original file's extension. When using this action to export a picture, you can tell VisualNEO for WindowsDB to use the original file extension by ending the name of the export file with .* instead of a normal extension. For example:


MyPhoto.*


If the original source of the picture data was a BMP file, NeoDBpro will export the file as:


MyPhoto.bmp

Example:

dbpExportBlob "DB1" "Employees" "Photo" "[PubDir]EmpPhoto.jpg"

SQL Equivalent:


N/A


dbpFieldToVar

Purpose:

Copy the contents of a single field from each record to a variable. Items will be separated by the specified delimiter. If a search query is active, only records matching the query will be copied. You can use this action to create a list of items in an entire table. For example, you could extract every part number from a database containing a hardware store's inventory. Those part numbers could then be displayed in one of VisualNEO for Windows's List or Combo Boxes.

Category:

Import/Export

Syntax:

dbpFieldToVar "database id" "table" "field" "variable" "properties"

database id

The name assigned to the database.

table

The name of the table containing the field to be copied.

field

The name of the field containing the data to be copied.

variable

The name of the variable where the field data will be stored. Each item will be separated by the delimiter specified in the properties parameter below.

properties

This is a compound parameter and can contain any combination of the following items:


Delimiter=char

The delimiter character that will be used to separate the copied field data. If you plan on displaying the data in a List or Combo box, you should use a carriage return as your delimiter. In VisualNEO for Windows a carriage return is entered as "[#13]".

SkipBlanks=Yes/No

Yes = do not include records where the specified field is empty. No = include blank records.

NoDuplicates=Yes/No

Yes = do not include the same field data more than once. No = allow duplicate data.

DelimiterInContext=value

This option determines what to do when the delimiter character appears within the exported data. Value may be one of the following:


Leave

Don't do anything. Leave the data as is.

Replace

Replace the delimiter with spaces.

UseCSVRules

Process the data according to the same rules used when exporting to CSV (comma separated values). Data containing the delimiter will be surrounded by double quotes.


Separate multiple items in a compound variable with semicolons (;).

Example:

dbpFieldToVar "AddrBook" "Contacts" "LastName" "[Names]" "Delimiter=,;SkipBlanks=Yes;NoDuplicates=Yes"

SQL Equivalent:


N/A

       

dbpRecordToVar

Purpose:

Copy the contents of the current record to a variable. The data from each field will be formatted in delimited ASCII format using the settings specified in the properties parameter. This action is similar to dbpExportToCSV, except that the data is sent to a variable instead of an external file. This action can be used in conjunction with dbpVarToRecord to copy and paste data from one record to another.

Category:

Import/Export

Syntax:

dbpRecordToVar "database id" "table" "variable" "properties"

database id

The name assigned to the database.

table

The name of the table containing the record to be copied.

variable

The name of the variable where the record data will be stored. Each field will be separated by the delimiter specified in the properties parameter below.

properties

This is a compound parameter and can contain any combination of the following items:


Delimiter=char

The delimiter character that will be used to separate field data in the variable.

IncludeHidden=Yes/No

Yes = export both visible and hidden fields. No = export only visible fields. Field visibility can be changed using the dbpSetColumnOrder action. By default, all fields are visible.

ForceQuotes=Yes/No

Yes = surround all field data with quote characters. No = do not use quote characters unless they are required. Normally quotes are only required when the field data contains the delimiter character.


Separate multiple items in a compound variable with semicolons (;).

Example:

dbpRecordToVar "AddrBook" "Contacts" "[RecData]" "Delimiter=,;IncludeHidden=No;ForceQuotes=No"

SQL Equivalent:


N/A


dbpVarToRecord

Purpose:

Paste the contents of a formatted variable to the current record. The data from each field will be formatted in delimited ASCII format using the settings specified in the properties parameter. This action is similar to dbpImportFromCSV, except that the data originates in a variable instead of an external file. This action can be used in conjunction with dbpRecordToVar to copy and paste data from one record to another.

Category:

Import/Export

Syntax:

dbpVarToRecord "database id" "table" "data" "properties"

database id

The name assigned to the database.

table

The name of the table containing the record to be copied.

data

This can be the actual formatted field data or a variable. The data must match the format of the table otherwise the data could be pasted into the wrong fields. Each field must be separated by the delimiter specified in the properties parameter below.

properties

This is a compound parameter and can contain any combination of the following items:


Delimiter=char

The delimiter character used to separate field data.

IncludeHidden=Yes/No

Yes = import data into fields regardless of whether or not they are visible. No = import data only to visible fields. Field visibility can be changed using the dbpSetColumnOrder action. By default, all fields are visible.


Separate multiple items in a compound variable with semicolons (;).

Example:

dbpVarToRecord "AddrBook" "Contacts" "[RecData]" "Delimiter=,;IncludeHidden=No"

SQL Equivalent:


N/A