Exchanging data

Paradox provides several ways to exchange data with other programs:

  You can import data from, and export data to, a variety of database, spreadsheet, and text formats.
  
  Object Linking and Embedding (OLE) is used to insert files from one application (an OLE sever) directly into another application (an OLE client). Paradox can act as both an OLE container and OLE server. When you place data into Paradox using OLE, you can then access the OLE source application directly from Paradox to changes. You can also use OLE to embed an entire Paradox table into another application's document and make changes to it from there.
  
  Dynamic Data Exchange (DDE) is used to send field values from a Paradox table to other applications, or to send data from other applications to a Paradox table or query. Programmers can use DDE in ObjectPAL to send commands to other applications. 
  
In this section, you'll learn about

  sharing information between workstations
  
  importing spreadsheet and table data
  
  importing text
  
  exporting data
  
  embedding objects in OLE fields and design objects
  
  inserting linked OLE objects
  
  manipulating OLE objects in tables, forms, and reports
  
  updating linked OLE objects
  
  using dynamic data exchange
  
For more information about using Paradox to exchange data with other applications, see Reference: Exchanging data.You can also exchange information with client/server database applications using Structured Query Language (SQL). For more information, see Connecting to SQL databases.

Sharing information between workstations

If you are sharing tables stored on a workstation's shared disk, the Local Share property for that workstation must be set to TRUE (using the Borland Database Engine Administrator, IDAPI or ODAPI utilities). Local Share only needs to be set to TRUE on the workstation that stores the tables. However, it is recommended that you set all your workstations to TRUE.

To set the Local Share property to TRUE

1	Click Start  Programs  WordPerfect Office Utilities  Borland Database Engine.

The BDE Administrator opens.

2	In the BDE Administrator window, click the Configuration tab.

3	In the list of categories, click Configuration  System.

4	Click INIT.

5	In the Definition page, click Local share.

6	Choose TRUE from the Local share list box.

Notes

  All BDE-based applications should be shut down when changing settings in the BDE Administrator.
  
  Configuring the Local Share property incorrectly can result in problems locking tables and records and the corruption of tables and indexes. To avoid problems entirely, you may want to set the Local Share property on all of your workstations to TRUE.
  
Importing spreadsheet and table data

You can import data from different spreadsheet and table formats to a Paradox or dBASE table. When you import spreadsheet data, you can select a specific block in the spreadsheet to import, or you can import the entire spreadsheet. To avoid conversion problems, you should edit the spreadsheet before importing. For more information, see Editing spreadsheets for importing

You can create a new table, replace data in an existing table, or add to data in an existing table. If you create a new table, Paradox defines its structure automatically. Then you can use Table Restructure to change it if you want.

You can also import data from text files into Paradox. For more information, see "Importing text". For a full listing of file formats that Paradox can import, see "Supported file formats".

To import spreadsheet data

1	Click File  Import.

2	Click Import.

3	In the From box, type the full path and filename of the spreadsheet you want to import. 

4	In the To box, type the name of the table into which you want to import data. 

5	If you are importing data into an existing table, enable one of the following options:

  Overwrite existing table- imports data over existing table data.
  
  Append to existing table- imports data without affecting existing records.
  
You can also...	

Create a table to log errors during importing.	Enable the Write transfer failures to problems.db check box.

Use the first row of data in the source file as field names.	Enable the Use first row of data as field names check box.

Notes

  When importing from a spreadsheet, Paradox automatically assigns field types to the data. For information on how field types are determined, see Determining spreadsheet field types
  
  If you have enabled the Use First Row of Data as Field Names option and more than one field seems to have the same name, Paradox adds letters to the duplicate fields (for example, CustomerA and CustomerB). If Paradox is unable to determine a field name from the imported file, it generates new field names beginning with the name FIELD001.
  
Tips

  If you don't know the name and path to the spreadsheet you are importing from, or the table you are importing to, you can click "..." to browse your files. 
  
  If you don't want to import the entire file, indicate the range you want to import by specifying the spreadsheet and cell information. For example, if you wanted to import cells A1 to B4 from spreadsheet A, you would enter the following range: A:A1..A:B4.
  
To import table data

1	Click File  Import.

2	Click Import.

3	In the From box, type the full path and filename of the file you want to import.

4	In the To box, type the name of the table into which you want to import data.

5	If you are importing data into an existing table, click the To table tab and enable one of the following options:

  Overwrite existing table-imports data over existing table data.
  
  Append to existing table-imports data without affecting existing records.
  
6	Click Import.

You can also	

Create a table to log errors during importing.	Enable the Write transfer failures to problems.db check box.

Write key violation errors to a separate table (if you are importing records to an existing file)	Enable the Write duplicate key records to keyViol.db check box.

Importing text

Paradox can import both delimited and fixed length text. 

Delimited text

Delimited text is text that is separated and/or enclosed by the characters you specify. In order for Paradox to read the text file, each line of the text file you want to import must end with a carriage return/linefeed combination to mark the end of a record. By default, Paradox expects the fields in the text file to be separated by commas with quotation marks surrounding each text field; however, if your file uses other characters, you can specify them.

When you import a delimited text file, Paradox scans the file to determine the number of fields and the field types the file contains. Dates are formatted to the Windows short format. Numbers are formatted to the Windows number format. Paradox trims strings longer than 255 characters and stores these as alpha fields.

Importing delimited text involves specifying the files you want Paradox to create during the import and then specifying the format of the delimited text in the source file so that Paradox interprets it correctly.

Fixed length text

When you import text, each line of the text file you want to import must end with a carriage return/linefeed combination to mark the end of a record. When you import a fixed length text file, you can define the field names and types of the fields in the new table. For each field name, you will need to enter a Type for the target table, a Start position (the position in the source where the column starts), and a Length (the source file's field size). Otherwise, Paradox assumes there is one alpha field in the first column of the table with a length of 255 characters. Dates are formatted to the Windows short format. Numbers are formatted to the Windows number format.

If you have previously imported data and saved the specifications, you can reload them. Similarly, once you set your import specifications, you can save them for later use. 

Importing fixed length text involves specifying all the files you want Paradox to use and/or generate, and then defining the name, type, and size of each field in the source file.

Note

  You can also import table and spreadsheet data. For more information, see Importing spreadsheet and table data.
  
  For a full listing of file formats which Paradox can import, see Supported file formats
  
To specify delimited text files to import

1	Click File  Import.

2	Click Import.

3	In the From box, type the full path and filename of the file you want to import.

4	In the To box, type the name of the table into which you want to import data. 

5	If you are importing data into an existing table, enable one of the following options:

  Overwrite existing table- imports data over existing table data.
  
  Append To existing table- imports data without affecting existing records.
  
You can also	

Create a table to log errors during importing.	Enable the Write transfer failures to problems.db check box.

Write key violation errors to a separate table (if you are importing records to an existing file)	Enable the Write duplicate key records to keyViol.db check box.

Note

  In order for Paradox to read the text file, each line of the text file you want to import must end with a carriage return/linefeed combination to mark the end of a record.
  
To specify the format of delimited text files

1	Click File  Import.

2	Click Import.

3	Click the From text tab.

4	In the Fields separated by area, enable one of the following options:

  Commas
  
  Semi-colons
  
  Tabs
  
5	In the Fields delimited by area, enable one of the following options:

  Quotation marks
  
  Nothing
  
6	In the Delimited fields area, specify what data will be delimited by enabling one of the following options:

  Text fields only
  
  All fields
  
7	In the Character Set area, enable one of the following options: 

  OEM
  
  ANSI
  
If you want to use the first row of data in the source file as field names, enable the Use first row of data as field names check box.

Note

  If you have enabled the Use First Row of Data as Field Names option and more than one field seems to have the same name, Paradox adds letters to the duplicate fields (for example, CustomerA and CustomerB). If Paradox is unable to determine a field name from the imported file, it generates new field names beginning with the name FIELD001.
  
Tip

  You can also import delimited text with the help of the Text Import Expert. To activate the Expert, click File, Import, and click Text Expert.
  
  You can also specify the characters to separate or delimit fields with by choosing Other and typing a character in the box beside it. 
  
To specify fixed length text files to import

1	Click File  Import.

2	Click Import.

3	In the From box, type the full path and filename of the file you want to import.

4	 In the To box, type the name of the table into which you want to import data.

5	If you are importing data into an existing table, click the To table page and enable one of the following options:

  Overwrite existing table--imports data over existing table data.
  
  Append To existing table- imports data without affecting existing records.
  
6	In the Character set area of the To text page, enable one of the following options:

  OEM
  
  ANSI
  
You can also	

Create a table to log errors during importing.	Enable the Write transfer failures to problems.db check box.

Write key violation errors to a separate table (if you are importing records to an existing file)	Enable the Write duplicate key records to keyviol.db check box.

Notes

  Files created in DOS-based applications, like Edit, typically use the OEM character set. Files created in Windows applications, like Notepad, typically use the ANSI character set.
  
  When you import text, each line of the text file you want to import must end with a carriage return/linefeed combination to mark the end of a record.
  
To define fields from fixed length text files

1	Click File  Import.

2	Click Import.

3	Click the From fields tab.

4	In the Field name box, type the name of the first table field.

5	In the Type box, type the field type.

6	In the Start box, type the column at which the field starts. 

7	In the Length box, type the length of the field.

If you want to save the import specifications, click Save spec and type a filename in the File name box.

Note

  Importing and exporting of date information depends on the mode setting in the BDE. For example, the date 12/20/98 will fail if the mode setting is anything other than m/d/y or 0. You must change your settings in the BDE to correspond with the date you are importing or exporting for the date to transfer correctly. All other dates in Paradox are affected by this change.
  
Tips

  You can also import fixed length text with the help of the Text Import Expert. To activate the Expert, click File, Import and click Text expert.
  
  If you want to use a previously saved import specification, click Load spec and choose the appropriate file. You can then modify the specification.
  
Exporting data

You can export data from Paradox tables to a number of different file formats. For example, you can export to a spreadsheet or a table. When you export data to a spreadsheet, Paradox converts each record to a row and each field to a column. When you export data to a table, you can create a new table or modify an existing one.

You can also ecport data to a delimited text or a fixed length text file. When you export data to a delimited text file, the table's field values are separated and/or enclosed (delimited) by the characters you specify. By default, field values in the exported file are separated by commas, and non-numeric values are enclosed in double quotation marks. Each record is separated by a carriage return and a linefeed character. Dates, numbers, and times are formatted as specified in the BDE Configuration Utility program (available in the Paradox program group). When you export table data to a fixed lenght text file, each record will be the same length. Dates, numbers, and times are formatted as specified in the BDE Configuration Utility program (available in the Paradox program group). These settings are called the export specifications.

For a full listing of the file formats to which Paradox can export, see Supported file formats

To export to a spreadsheet

1	Click File  Export.

2	In the From box, type the full path and filename of the table you want to export. 

3	In the To list box, choose the spreadsheet format you want to export to.

If you want to place field names in the first row of data, enable the Use first row of data as field names check box.

Notes

  If a value is wider than the column display width, the full value is converted but partially hidden. If a date in the original table is beyond the range of the allowable dates in the spreadsheet, the date is exported as the value ERROR.
  
  Dates are exported to spreadsheets as integers representing that date. Format your date column in the spreadsheet as a date to see them properly.
  
Tip

  If you don't know the name and path of the table you want to export, you can click the "..." button and browse to a table.
  
To export data to a table

1	Click File  Export.

2	In the From box, type the full path and filename of the table you want to export.

3	In the To type list box, choose the type of table you want to export to.

4	In the To box, type the full path and name of the file you want to export to.

5	If you are exporting to an existing table, enable one of the following options:

  Overwrite existing table-overwrites the existing table data.
  
  Append to existing table-adds new records to the existing table without affecting existing data. 
  
You can also	

Create a table to log errors during exporting.	Enable the Write transfer failures to problems.db check box.

Write key violation errors to a separate table (if you are exporting records to an existing file)	Enable the Write duplicate key records to keyviol.db check box.

Tip

  If you don't know the name and path of the table you want to export, you can click the "..." button and browse to a table.
  
To export to delimited text

1	Click File  Export.

2	In the From box, type the full path and filename of the table you want to export.

3	Choose ASCII delimited f rom the To type list box.

4	In the Fields separated by area, enalble one of  the following options:

  Commas
  
  Semi-colons
  
  Tabs
  
5	In the Fields delimited by area, enable of the following options:

  Quotation marks
  
  Nothing
  
6	In the Delimited fields area, specify what data will be delimited by enabling one of the following options:

  Text fields only
  
  All fields
  
7	In the Character set area, enable one of the following options:

  OEM
  
  ANSI
  
If you want to place the field names in the first row of data, enable the Use first row of data as field names check box.

Note

  Paradox cannot export memo (Paradox or dBASE), formatted memo, graphic, OLE, or binary field types to delimited text. These types will not be included in the exported text file.
  
Tip

  If you don't know the name and path of the table you want to export, you can click the "..." button and browse to a table.
  
To export to fixed length text

1	Click File  Export.

2	In the From box, type the full path and filename of the table you want to export.

3	Choose ASCII fixed from the To type list box.

4	In the Character set area, enable one of the following options.

  OEM
  
  ANSI
  
You can also	

Save the export specification.	Click Save spec, and type a filename in the File name box.

Display the export specification.	Click the To fields tab and click Reset.

Notes

  When you export to a fixed length file, a file with extension .SCH is created in the same directory. The .SCH file contains this information about the new file: table name, new file type, character set used. It also contains descriptive data for each field, including name, type, size, decimal placement, and column start location (in spaces).
  
  Importing and exporting of date information depends on the mode setting in the BDE. For example, the date 12/20/98 will fail if the mode setting is anything other than m/d/y or 0. You must change your settings in the BDE to correspond with the date you are importing or exporting for the date to transfer correctly. All other dates in Paradox are affected by this change.
  
Tip

  If you don't know the name and path of the table you want to export, you can click the "..." button and browse to a table.
  
  If you want to use a previously created export specification, click Load spec instead of Reset.
  
Embedding objects in OLE fields and design objects

To make a table, form or report more interesting and informative, you can include data such as pictures, detailed notes, spreadsheets, graphics, charts, and similar items. When you define a field type as OLE, or a design object as an OLE container, you have created an area in which you can embed special data from other sources. 

You can create new OLE objects in the OLE server application and embed it into an OLE table field, a form, or a report. You can also embed copies of exisiting OLE objects into tables, forms, and reports. 

You may also want to insert a copy of a Paradox table into another application. You can do this by using the Clipboard or the Insert Object command.

For more information on OLE, see Understanding OLE.For more information on embedding objects, see Embedded OLE objects.

To create a new OLE object and embed it in an OLE field

1	In Edit mode, select an OLE field.

2	Right-click the OLE filed, and click Insert object.

3	In the Insert object dialog box, enable the Create new check box.

4	From the Object type list, choose the program you want to use to create the object.

If you want Paradox to display the value as an icon in the field, enable the Display as icon check box.

5	Click OK.

If the OLE object comes from an OLE 2.0 server application, Paradox places a blank OLE object in the field and creates an in-place editing environment where you can use the server application's standard commands and toolbar buttons to create the new object. 

If the server uses OLE 1.0, the server application opens and you can edit the object within it.

6	Create the object using the chosen application.

7	Click outside the chosen application.

To create a new OLE object and embed it in a form or report

1	With a form or report open, click View, and click one of the following

  Design form
  
  Design report
  
2	Use the OLE tool to create a design object.

3	Right-click, and choose Insert object.

4	Enable the Create new button.

5	From the Object type list, choose the program you want to use to create the object.

If you want Paradox to display the value as an icon in the field, enable the Display as icon check box.

6	Click OK.

If the OLE object comes from an OLE 2.0 server application, Paradox places a blank OLE object in the field and creates an in-place editing environment where you can use the server application's standard commands and toolbar buttons to create the new object. 

If the server uses OLE 1.0, the server application opens and you can edit the object within it.

7	Create the object using the chosen application.

When you are finished creating the object, close the OLE server (the other program) by clicking somewhere outside of the OLE object. Paradox embeds the object in the OLE field.

To embed a copy of a file in a table field

1	In Edit mode, select the OLE field.

2	Right-click, and click Insert object.

3	Enable the Create from file check box.

4	In the File box, type the full path and filename of the file you want to embed in the OLE field.

To embed a copy of a file in a form or report

1	With a form or report open in the design window, click View, and click one of the following

  Design form
  
  Design report
  
2	Use the OLE tool to create a design object (box) to hold the OLE object.

3	Right-click and choose Insert object.

4	Enable the Create from file check box.

5	In the File box, type the full path and filename of the file you want to embed in the OLE field. 

To embed part of a file using Copy and Paste

1	Open the OLE server, and select the value you want to place into Paradox. 

2	Use that application's Copy command to copy the data to the Clipboard.

3	Return to Paradox.

4	Do one of the following:

  If you are embedding the object in an OLE field in a table or in a form bound to that table, press F9 to switch to Edit mode. Click View  Memo View if your OLE field is a memo field, or View  Field View if your OLE field is a BLOB field.
  
  If you are embedding the object in an OLE design object in a form or report, click View  Design form or View  Design report to enter Design mode and select the object.
  
5	Click Edit  Paste.

The OLE value displays in the field as an embedded OLE object.

To copy a Paradox table to another application

1	In Paradox, open a table.

2	Click Edit  Select all.

3	Click Edit  Copy.

4	In the OLE container application, choose the command that the application uses to embed OLE objects. 

The Paradox table appears in the other program (the container). You can edit the table by either opening Paradox from the OLE container or using in-place editing.

Note

  Some common commands used by OLE containers to embed OLE objects are Edit  Paste  Edit  Paste special or Edit  Paste link..
  
To embed a Paradox table using the Insert Object command

1	In an OLE container application, click Edit, and click one of the following:

  Insert object
  
  Insert  Object
  
2	In the Insert object dialog box, choose Paradox table from the Object type list. 

3	Click OK.

The OLE container starts Paradox, and opens the Open table dialog box.

4	Choose the table you want to embed.

Paradox opens the selected table. Close the Table window to return to the OLE container. The Paradox table appears in it.

Inserting linked OLE objects

If you want objects such as spreadsheets, photographs, or charts in your table, you must insert and link the object to your OLE field. An OLE linked object is stored in its original application. When the original file is updated, so is your OLE field by virtue of the link you have defined. You can decide whether you want these updates to appear automatically or if you want to manually update the object.

You can insert lOLE objects linked to files into tables, forms or reports, and you can choose to link to all or part of a file.

For more information on OLE, see Understanding OLE.For more information on linking objects, see Linked OLE objects.

To insert an OLE object linked to a file into a table

1	In Edit mode, select an OLE field.

2	Right-click and choose Insert object.

3	Enable the Create from file check box.

4	In the File box, type the full path and filename of the file you want to embed in the OLE field .

5	Enable the Link check box.

To insert an OLE object linked to a file into a form or report

1	With a form or report open, click View, and click one of the following

  Design form
  
  Design report
  
2	Use the OLE tool to create a design object (box) to hold the OLE object.

3	Right-click and choose Insert object.

4	Enable the Create from file check box.

5	In the File box, type the full path and filename of the file you want to embed in the OLE field. 

6	Enable the Link check box.

To insert an object linked to part of a file using Copy and Paste Special

1	Open the OLE server and select the value you want to place into Paradox. 

2	Use that applications's Copy command to copy the data.

3	Return to Paradox.

4	Do one of the following:

  If you are embedding the object in an OLE field in a table or in a form bound to that table, press F9 to switch to Edit mode. Click View  Memo view if your OLE field is a memo field, or View  Field view if your OLE field is a BLOB field.
  
  If you are embedding the object in an OLE design object in a form or report, click View  Design form or View  Design report to enter Design mode.
  
5	Select the OLE field or OLE design object in which you want to paste the OLE object.

6	Click Edit  Paste special.

The OLE value appears in the field as a linked OLE object. 

Manipulating OLE objects in tables, forms, and reports

Just as you can edit data in alpha or money fields, you can edit objects in OLE fields. While in Paradox, you can edit OLE object in tables, forms, and reports, from its source application whether the object is linked or embedded. If you have instructed Paradox to update a linked OLE object automatically, the changes will display as soon as you return to your field or design object. You can also choose to manually update OLE objects.

To manipulate an OLE object in a table

1	In Edit mode, select an OLE field.

2	.Click View, and click one of the following:

  Memo view- if your OLE field is a memo
  
  View  Field view- if your OLE field is a BLOB field
  
3	Click the Edit menu, and click the last command on the menu.. 

The last command on the Edit menu is the name of the OLE server associated with the object in the OLE field. 

4	Click one of the commands in the submenu.

5	Modify the object.

6	Save the object.

7	Close the source application.

To manipulate an OLE object in a form or report

1	With a form or report open, click View, and click one of the following

  Design form
  
  Design report
  
2	Click the OLE design object.

3	Click the Edit menu, and click the last command on the menu.. 

The last command on the Edit menu is the name of the OLE server associated with the object in the OLE field. 

4	Click one of the commands in the submenu.

5	Modify the object.

6	Save the object.

7	Close the source application.

Note

  When you are finished manipulating a linked OLE object, Paradox updates it automatically if you have specified it to do so in the Links dialog box. If you have specified that you want to update the OLE object manually, you can use the Update Now command. For more information, see "Updating linked OLE objects."
  
Tips

  Double-clicking the OLE field executes the default command (the first command in the submenu), usually Edit.
  
  If you are manipulating this object using a form, right-click the field. The commands available for this object appear on the menu. If you are manipulating this object using a table, press F2 to switch to Field View and then right-click the field.
  
Updating linked OLE objects

You link an OLE object because you know the object is not static and will change in its source application, and you want your table, form or report to contain the latest versions of the object. Paradox can update your linked OLE object automatically to reflect changes that have occurred in the OLE server; however, you may also choose to do it manually.

Some objects behave differently from other objects when manipulated. Differences are sometimes due to the version of OLE supported by an OLE server. There are two kinds of OLE servers: OLE 1.0 and OLE 2.0. For more information, see OLE 1.0 vs OLE 2.0.

To update a linked OLE object in a table

1	In Edit mode, select an OLE field.

2	Click View, and then one of the following

  Memo view- If your OLE field is a memo field
  
  Field view- If your OLE field is a BLOB field
  
3	Click Edit  Links.

4	Do one or more of the following:

  Use the Update buttons to choose whether you want the selected link to be updated manually (when you choose) or automatically.
  
  Choose Update now to immediately make the appearance of a linked object match that of its source. See "To update an object manually" for more information.
  
  Choose Open source to open the server application and source file of the selected link.
  
  Choose Change source to change the source file of the selected link. Paradox opens the Change Source dialog box. Use this to choose a new source file for the link.
  
  Choose Break link to break the link. This causes the selected OLE value to become a static, embedded object. Now the object can't be automatically updated when the source data changes.
  
To update a linked OLE object in a form or report

1	With a form or report open, click View, and click one of the following:

  Design form
  
  Design report
  
2	Select the OLE object.

3	Click Edit  Links.

4	Do one or more of the following:

  Use the Update buttons to choose whether you want the selected link to be updated manually (when you choose) or automatically.
  
  Choose Update now to immediately make the appearance of a linked object match that of its source. See "To update an object manually" for more information.
  
  Choose Open source to open the server application and source file of the selected link.
  
  Choose Change source to change the source file of the selected link. Paradox opens the Change Source dialog box. Use this to choose a new source file for the link.
  
  Choose Break link to break the link. This causes the selected OLE value to become a static, embedded object. Now the object can't be automatically updated when the source data changes.
  
To update an object manually

1	Do one or both of the following:

  If you are working with an OLE field in a table or in a form bound to that table, press F9 to switch to Edit mode. 
  
  If you are working with an OLE field object in a form or report, click View  Design form or View  Design report.
  
2	Click the OLE field or design object to select it.

3	Click Edit  Links  Update now.

Using Dynamic Data Exchange (DDE)

Dynamic Data Exchange (DDE) lets you communicate with other applications that support DDE. You can use DDE to send field values from a Paradox table to other applications or to send data from other applications to a Paradox table or query. For example, you may use a spreadfsheet to perform calculations on data taken from a field in a Paradox table, and you may take values from another application and perform queries on them in Paradox. You can disconnect and reconnect the DDE links between Paradox and other applications at any time.

You can also use Paradox as both DDE client and server, all actions can be performed within Paradox. For example, a linked field can run a query (the DDE client). When the field value changes in the source table (DDE server), an updated Answer table appears.

To use Paradox as a DDE server

1	With a table open, select any value in the field, and click Edit  Copy. 

The field is copied to the Clipboard.

2	In the DDE client spreadsheet, click Edit  Paste special to place the field in the appropriate spreadsheet cell.

3	 In the Paste special dialog box, enable the Paste link option.

You are not placing an actual value in the spreadsheet. Instead, you are using DDE to indicate to the spreadsheet where to look for the value.

Notes

  You can use DDE to place Paradox fields in any type of application that is a DDE client. Spreadsheets, word processors, and a variety of other applications can accept Paradox field values through DDE.
  
  For more information on using Paradox as a DDE server, see To use Paradox as a DDE server (example)
  
To use Paradox as a DDE client (tables)

1	Copy the value you want to use from your DDE source application. 

2	In Paradox, click the alpha field where you want to place the DDE value. and then click Edit  Paste special.

You see link information like @DDE:"QPW"!"C:\QPW\NOTEBK1.WB1"!"$A$D$2"!@. This is a string that tells Paradox where to look for the DDE value. This example string tells Paradox to look for a Quattro Pro for Windows file located on C:\QPW in Notebook 1, page A, cell D2.

Note

  In Paradox, you view the link information rather than the DDE value. To view the value in the DDE server, select the field and press Shift + F2. Paradox displays a message telling you it is launching the DDE server and then opens the application and the correct file.
  
  The alpha field must be large enough to hold link information.
  
To use Paradox as a DDE client (queries)

1	Highlight the item in the server, then copy it to the Clipboard. 

Most servers use Edit  Copy to place a copy of the object on the Clipboard.

2	Return to the client (Paradox) Query window.

3	Select the QBEgloss_qbe field to receive its value from the server.

4	Click Edit  Paste link.

5	Click Query.

DDE will tell Paradox to execute the query each time data is sent from the server.

To use DDE to run a query (example)

1	Click File  New  Query

2	Choose Lineitem.db and Orders.db, and click Open.

3	Click the checkboxes for the Orders field in both the Lineitem and Orders tables.

4	Click File  Open  Table, and double click the Customer.db table.

5	Select Customer No. 1221 and click the Copy button on the toolbar.

6	In the Query window, position the text insertion point in the Customer No. field of the Orders table, and click Edit  Paste link. 

Link information from the Customer table appears in the field.

7	Click Query  Run query. 

Paradox creates an Answer table listing all of Customer No. 1221's items.

To use DDE to run a query interactively (example)

1	Click File  New  Query

2	Choose Lineitem.db and Orders.db, and click Open.

3	Enable the checkboxes for the Orders field in both the Lineitem and Orders tables.

4	Click File  Open  Table, and double click the Customer.db table.

5	Select Customer No. 1221, and click the Copy button on the toolbar.

6	Click the Query window's title bar to activate the window.

7	Click Query  Wait for DDE.

8	Click the Customer table's title bar to activate the window and select Customer No. 1221. 

9	Press the Down arrow to move to Customer No. 1231. When you select the new value, Paradox activates the DDE link and runs the query again, updating the Answer table with the new value's data.

Tip

  You can click Query  Wait for DDE so that there is no check mark beside the menu command if you want to scroll quickly through the Customer table without running a query on each record's value.
  
To disconnect and reconnect DDE links

To...	Do the following

Disconnect DDE links	Click Format  Notify on so that no check mark appears beside the menu option in Paradox.

Reconnect DDE links	Click Format  Notify on so that a check mark appears beside the menu option in Paradox.

Note

  If you create a DDE link to an entire table, Format  Notify on works similarly. When any record in the linked table changes, the entire table is refreshed in the DDE client. Changes are posted in the table whenever the person editing the table moves off the record.
  
  Notify On is activated only if Wait for DDE is selected in the query.
  
Reference: Exchanging data

This section contains reference pertaining to exchange data between Paradox and other applications.

Supported file formats (import)

Paradox can import files in the following formats:

  ASCII Delimited (.txt, .csv)
  
  ASCII Fixed (.txt)
  
  dBASE tables (.dbf)
  
  Excel 3, 4, 5/95, 97 (.xls)
  
  Lotus 1-2-3 v.1 (.wks)
  
  Lotus 1-2-3 v.2 (.wk1)
  
  Paradox tables (.db)
  
  Quattro DOS (.wkq)
  
  Quattro Pro DOS (.wq1)
  
  Quattro Pro Windows 1 (.wb1)
  
  Quattro Pro Windows 6 (.wb2)
  
  Quattro Pro Windows 7,8 (.wb3)
  
  Quattro Pro 9 (.qpw)
  
Supported file formats (export)

Paradox can export files to the following formats:

  ASCII Delimited text (.txt, .cvs)
  
  ASCII Fixed length text (.txt)
  
  dBASE 5 (.dbf)
  
  dBASE III+ (.dbf)
  
  dBASE IV (.dbf)
  
  Excel 3, 4, 5/95, (.xls)
  
  Lotus 1-2-3 v.1 (.wks)
  
  Lotus 1-2-3 v.2 (.wk1)
  
  Paradox 3.x "Compatible" (.db)
  
  Paradox 4.x "Standard" (.db)
  
  Paradox 5, 7, 8 (.db)
  
  Quattro DOS (.wkq)
  
  Quattro Pro DOS (.wq1)
  
  Quattro Pro Windows 1, (.wb1)
  
  Quattro Pro Windows 5 (.wb1)
  
  Quattro Pro Windows 6 (.wb2)
  
  Quattro Pro Windows 7, 8 (.wb3)
  
  WordPerfect 8, 9 (.wpd)
  
  WordPerfect 8, 9 Merge File (.wpd)
  
Editing spreadsheets for importing

For best results, do the following before importing a spreadsheet:

  Remove extraneous entries (such as hyphens, asterisks, and exclamation points).
  
  Make sure each column contains only one kind of data and uses only one formatting option.
  
  When importing dates, ensure you import year dates with all four digits to avoid confusion about the implied century.
  
  Place column titles in the top row of the selected range, because Paradox uses the first row that contains text to generate field names. (If there are no column titles on the spreadsheet, disable the Use first row of data as field names check box in the Spreadsheet import dialog box.)
  
Determining spreadsheet field types

When you import data from a spreadsheet, Paradox automatically assigns field types to the data. The following table shows how Paradox determines a field's type.

Spreadsheet value	Paradox field type	dBASE field type

Labels	Alpha	Character

Integers	Short, Long Integer, or Number (depends on value)	Float number (6,0) or more (depends on value)

Decimal numbers	Number	Float number (20,4)

Money	Money	Float number (20,4)

Dates	Date	Date

Date/Time (Excel)	Timestamp	Character

Time (Excel)	Time	Character

The following rules determine which category a column falls into. The data type for a column is whatever data type can hold all the values in the column.

Column contains	Converted to

Label (text) cell	Alpha field (or dBASE character field)

Dates and numbers	Alpha field (or dBASE character field)

Money only	Money field in a Paradox table

Money and numbers	Number field

Dates and times	Timestamp field (or dBASE character field)

As a result of these conversion rules, Paradox often imports numbers in unedited spreadsheets as alpha fields. For example, spreadsheet columns often have rows of hyphens separating sections of numbers. Since only an alpha field can contain both the numbers and hyphens, the column is converted to an alpha field even though it contains mostly numbers

Understanding OLE

Object Linking and Embedding (OLE) provides a way for a data file from one application (for example, a Paradox table) to contain data from another application (for example, a spreadsheet). OLE makes it possible for you to view and edit this data in Paradox without ever leaving Paradox. For example, you can use OLE to link or embed a CorelDRAW image in a graphic field of a table. In this example, Paradox acts as the OLE container and CorelDRAW acts as the OLE server.

You can use OLE fields to hold virtually any kind of data, from graphics to text to calculations. The advantage of using an OLE field is that once you place a linked OLE value, it maintains a link to its source application. You can always open the source application from the OLE object that you place in a Paradox table or form. Changes you make to the OLE object are then updated in your Paradox table or form.

Paradox can act as both an OLE container and an OLE server.

Paradox as an OLE container

OLE containers can be added to tables, forms, and reports. For example, you can add an OLE field to a table you use to organize sound (.wav) files, allowing you to actually store, play, and edit the .WAV files without ever leaving Paradox. Paradox provides OLE containers in two ways: as a field in a table and as a design object in a form or report.

How you can manipulate an object depends on the kind of OLE server associated with the object. For example, a sound (.wav) file might be associated with a sound editor that provides two commands: play and edit.

You can insert two kinds of objects into an OLE container: embedded objects and linked objects.

Paradox as an OLE server

Paradox acts as an OLE server by providing a way to insert a Paradox table into another application's file, such as a WordPerfect or Quattro Pro file. Depending on the type of OLE object, you can manipulate the object in various ways: open, edit, view, or play it

Note

  Most server applications use OLE 2.0, but a few might still use OLE 1.0, which doesn't support in-place editing. For more information on the difference between edits and updates in OLE versions, see "OLE 1.0 versus OLE 2.0."
  
Linked OLE objects

A linked object is actually a pointer to data somewhere outside of the OLE container. When you insert a linked object in an OLE container, changes you make to the object are actually made to the source of the object. Furthermore, if you change the source of the object, the object changes in the OLE container. Using linked OLE objects is helpful when you need to display live data that is automatically updated whenever the original data changes in another application. OLE links can also produce smaller file sizes than when you embed large objects (such as graphics files) because the object itself stays in another file.

For example, suppose you insert a link to a WordPerfect document in an OLE field in a Paradox table. Later, you modify the WordPerfect document. Your modifications also display in the field in the table. If you copy the Paradox table to a disk, the text from the WordPerfect document is not copied along with the table.

You can make Paradox update the appearance of linked objects automatically. You can also choose to update their appearance manually.

Note

  Paradox provides OLE containers in two ways: as a field in a table and as a design object in a form or report.
  
Embedded OLE objects

An embedded object is one you create or copy from a file or the Clipboard. When you embed an object in an OLE container, the data is actually copied into the OLE container, and no relationship is maintained with the source of the data. For example, suppose you copy an image from CorelDRAW to the Clipboard and paste it into an OLE design object in a Paradox form. You can edit and format the object in the form using CorelDRAW; however, the original file from which you copied the image stays unchanged. Furthermore, if you copy the form to a disk, the image is copied along with the form.

Note

  If the OLE object is embedded in a table field instead of a design object, it is stored in the .MB file with other table data.
  
OLE 1.0 vs OLE 2.0

When you manipulate an object from an OLE 1.0 server, Paradox starts the OLE server (the program used to create the OLE object) to let you work with the object. After you finish working with the object, close the OLE server to return to Paradox and save the changes to the object.

For example, if an OLE field contains a word processing document, and you choose the Edit command. Paradox opens the document in the word processor. If you make some changes to the document and close the word processor. A dialog box displays, giving you the opportunity to save the changes to the object. When you click OK and return to Paradox, the object in the OLE field is updated with the changes you made.

When you manipulate an object from an OLE 2.0 server, different commands may cause different actions. Typically, one command (Open) starts the OLE server (the program used to create the OLE object). Another command (Edit) initiates in-place editing. With in-place editing, all the tools and menus you need appear inside the Paradox desktop. In essence, the OLE server takes control of the Paradox desktop, including the toolbar, the status line, and the menus. The area inside the OLE field becomes the working area for the OLE server. The only menus that Paradox still controls are File and Window. To end in-place editing and restore the standard Paradox environment, click the table or form outside the OLE field or design object.

For example, if an OLE field contains a video file, and you click the Play command, video controls appear at the bottom of the OLE field and some new menu commands appear on the Paradox desktop. The video plays inside the OLE field. You use the video controls to pause and jump to another frame in the video. You can click another field in the table to close the video player.

Paradox as an OLE 2.0 server

You can embed existing Paradox tables in OLE container applications such as word processors or spreadsheets. To do this, you can use the Edit   Insert Object command or the Windows Clipboard.

If the container application supports OLE 2.0, you can use in-place editing to edit the Paradox table. When you use in-place editing, certain functions are unavailable:

  You cannot right-click the table to see its properties.
  
  You cannot enter Memo view.
  
  Certain prohibited menu commands are not visible.
  
The Paradox table you place in the container always maintains a relationship with the Paradox source table. This means if you delete the Paradox file from disk, it will no longer displays in the OLE container (even if it was embedded in the OLE container). 

To use Paradox as a DDE server (example)

1	In Paradox, open the Orders table. 

2	Select the first record's Total Invoice value.

3	Click Edit  Copy.

3	Open a spreadsheet, such as Quattro Pro, select a notebook cell and click Edit  Paste special.

4	Enable the Paste link check box in the Paste special dialog box.

5	To see how DDE works, place your Paradox window and your spredsheet window together on the screen.

6	Select the Total Invoice field in Paradox and press the up and down arrows to move through invoice values. 

Notice how the value shown in the notebook cell in Quattro Pro changes to display the Total Invoice value in the currently selected Paradox record.

Note

  In Quattro Pro, you can create calculations that use the value from Paradox. As the DDE value is updated, the calculated result is updated along with it. 
  



