Top Banner
Data import/export utility for NewWayService 4 Copyright © 1996-2009 OroLogic Inc. http://www.orologic.com Revision 4.01
46

Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Feb 24, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Data import/export utility for NewWayService 4

Copyright © 1996-2009 OroLogic Inc. http://www.orologic.com Revision 4.01

Page 2: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Contents

Data import/export utility for NewWayService 4

I

Contents

Introducing the data import/export utility____________________________________________ 1

What is the data import/export utility ___________________________________________________ 1

Accessing data with Microsoft ADO ____________________________________________________ 1

Starting the data import/export utility __________________________________________________ 2

Importing data _________________________________________________________________ 3

Introduction ________________________________________________________________________ 3

Importing data step by step ___________________________________________________________ 3 Step 1/8: What do you want to do ?______________________________________________________________3 Step 2/8: Select the data source_________________________________________________________________4 Step 3/8: Select the table to import ______________________________________________________________5 Step 4/8: Specify the NewWayService 4 database __________________________________________________5 Step 5/8: Technician code and password__________________________________________________________5 Step 6/8: Select the destination module where data will be imported ____________________________________5 Step 7/8: Associating source fields to destination fields ______________________________________________7 Step 8/8: Last parameters and starting the import process ____________________________________________9

Exporting data ________________________________________________________________ 11

Introduction _______________________________________________________________________ 11

Exporting data, step by step __________________________________________________________ 11 Step 1/8: What do you want to do ?_____________________________________________________________11 Step 2/8: Specify the NewWayService 4 database _________________________________________________11 Step 3/8: Technician code and password_________________________________________________________12 Step 4/8: Select data to export_________________________________________________________________12 Step 5/8: Select the destination of exported data___________________________________________________13 Step 6/8: Select the destination table____________________________________________________________14 Step 7/8: Associating source fields to destination fields _____________________________________________14 Step 8/8: Last parameters and starting the export process____________________________________________15

Use of scripts, using the Object Pascal language _____________________________________ 17

Object Pascal language reference _________________________________________________ 20

Object Pascal language overview ______________________________________________________ 20 Statements: _______________________________________________________________________________20 Data types:________________________________________________________________________________20 Operators: ________________________________________________________________________________20

Standard routines __________________________________________________________________ 21 String functions ____________________________________________________________________________21 Conversion functions________________________________________________________________________22 Format functions ___________________________________________________________________________24 DateTime functions _________________________________________________________________________28 Math functions_____________________________________________________________________________29 Other useful functions _______________________________________________________________________32

Automatic data import/export ____________________________________________________ 33

Page 3: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Contents

Data import/export utility for NewWayService 4

II

Data dictionary ________________________________________________________________ 35

List of entities of the NewWayService 4 database_________________________________________ 35

Tutorials _____________________________________________________________________ 36

Tutorial 1 – Importing products_______________________________________________________ 36

Tutorial 2 – Importing customers and writing script using Object Pascal language ____________ 38

Tutorial 3 – Exporting customers to an MS Access database file ____________________________ 40

Tutorial 4 – Exporting spare parts and use of an Object Pascal script _______________________ 42

Page 4: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Introducing the data import/export utility

Data import/export utility for NewWayService 4

1

Introducing the data import/export utility

What is the data import/export utility The data import/export utility for NewWayService 4 is a powerful program allowing you to update NewWayService 4 information from an external data source (import) or update external data from NewWayService 4 information (export). For example, with the data import/export utility, you could import the list of your customers and the list of your products sold, from your accounting software to NewWayService 4 or on the other side, export the list of spare parts entered on your work orders to your accounting software (see figure 1 below)

Figure 1

In addition to import/export functionalities, this utility allows you to : - Use scripts (Object Pascal language) to give you more flexibility when importing or exporting data (ex.:

data filtering when importing or exporting data, concatenate fields, etc.). - Save your import/export parameters for later use. - Automatically run data import or data export (for example, over the night) with the help of a schedule

utility software such as the Windows schedule utility. IMPORTANT: Before exporting data directly to another software's database (for example, your accounting software's database) verify with the manufacturer of your software that you can do that without any problem. Since each manufacturer have his own way to keep data into databases, exporting data to one of these databases without any precautions could seriously damage data.

Accessing data with Microsoft ADO The data import/export utility uses the ADO (ActiveX Data Objects) data access system developed by Microsoft. One advantage of using ADO is to be able to access uniformly many kinds of database using drivers such as OLE DB or ODBC. For example, with ADO, you can access simple dBase, Excel or MS Access files as well as more sophisticated databases such as Firebird, Oracle or MS SQL. ADO is compatible with the ODBC (Open DataBase Connectivity) technology. If you use an ODBC driver to access a specific database, you will be able to access this database with the import/export utility. ADO is a part of the MDAC (Microsoft Data Access Components). The MDAC is a set of components specifically designed for data access and contains the ADO, OLE DB and ODBC data access systems.

Page 5: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Introducing the data import/export utility

Data import/export utility for NewWayService 4

2

MDAC is now automatically installed with latest Windows versions (Windows 2000 or higher) as well as latest Microsoft products such as MS Office 2000 or Higher. When using the data import/export utility, a verification is automatically made to check that the Microsoft MDAC is installed on your computer. If the MDAC if not detected, an information message will be displayed on screen, informing you that the MDAC is required to run this utility. In this case, you just have to download and install absolutely free the MDAC from the Microsoft web site at http://www.microsoft.com/data/ . Note that only version 2.1 or higher of the Microsoft MDAC is compatible with the data import/export utility for NewWayService 4. If you need more information about ADO or the MDAC, or you need to download the latest version of the MDAC, please visit the special section of the Microsoft web site at http://www.microsoft.com/data/ . This section contains many useful information about accessing different kinds of database using the MDAC.

Starting the data import/export utility To start the data Import/export utility, click on Start in the Windows’ task bar and select the Programs menu. Then, select the NewWayService 4 folder and click on Data import/export utility. After some seconds, you will be in the main window of the data import/export utility, ready to use it. Select Import data to NewWayService 4 to import data, or Export data from NewWayService 4 to export data. Then, click on the button Start to start the assistant which will guide you through the process.

Refer to the Importing data and Exporting data sections below for more information.

If you get a message indicating the the Microsoft MDAC was not detected, download and install absolutely free the MDAC from the Microsoft web site as indicated in the previous section then start the data import/export utility again.

Page 6: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Importing data

Data import/export utility for NewWayService 4

3

Importing data

Introduction This section explains you how to import data into NewWayService 4. You can import data into the following modules: - Products - Customers - Serial numbers - Spare parts - Articles (Knowledge base) - Suppliers Note that since adding work orders is a process which requires several validations, you cannot import work orders directly into NewWayService 4. However, users of NewWayService 3 can use the NewWayService 3 to NewWayService 4 data transfer utility included with NewWayService 4 to transfer all data to NewWayService 4 by a simple mouse click. A data transfer utility from NewWayService 2 to NewWayService 4 is also included with NewWayService 4.

Importing data step by step Step 1/8: What do you want to do ? This step allows you to load a file containing import parameters previously saved in a previous import process. This is very useful when you import data from the same source on a regular basis. This avoid you to reenter import parameters each time. If it’s the first time you import data with this utility, select Start a new data import then click the Next button to continue to step 2. If you want to load parameters of a previous import process, select Import data from previously saved parameters, then select the file containing your import parameters by using the … button. Click the Next button to continue to step 2.

Page 7: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Importing data

Data import/export utility for NewWayService 4

4

Step 2/8: Select the data source This step allows you to specify where is the data and in which format is the data to import. If your data is in an MS Access, dBase, MS Excel, Paradox, Lotus, Html or Text file, just select the file to import using the … button then click the Next button to continue to step 3. If your data are in another file format or in a more sophisticated database, select the other data source (ADO, Other file format, SQL, ODBC, etc) option, then, click the Select the data source button to display the ADO connection utility. Click the Build button to access the different tabs.

The ADO connection utility can differ, depending of the ADO and/or Windows version you currently use. From the utility, select the data source type you want to access (usually from the Provider tab) then, type the connection parameters, specific to your data source (usually from the Connection tab). The provider list available from the ADO connection utility (Provider tab) can differ between computers, depending the ADO and/or Windows version used and software installed. As indicated previously, visit the ADO section of the Microsoft web site at http://www.microsoft.com/data/ for more information and/or download the latest version of the MDAC. A few examples of providers that can be available: The Microsoft Jet 4.0 OLE DB Provider is usually available and is used to access data file such as MS Access, MS Excel, dBase, Lotus, Exchange, Paradox, Text, Html or any other file format that Microsoft could add. The Microsoft OLE DB Provider for SQL server provider should be available if you currently use the MS SQL database server into your organization and that the MS SQL client software has been installed on your computer. Use this provider to access an MS SQL database. The Microsoft OLE DB Provider for ODBC Drivers provider is also usually available. Use this provider to access a data source through an ODBC driver. As you can see, ADO allows you to access most of the databases available on the market. However, the configuration process of the connection can differ, depending on the type of data you want to access. Please, refer to your database documentation to enter correct ADO connection parameters. The assistance of your database administrator is also strongly recommended. When all ADO connection parameters have been entered, click the Test connection button to verify the connection to your data source. If the connection test is successful, click the OK button to close the ADO

Page 8: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Importing data

Data import/export utility for NewWayService 4

5

connection utility and to return to the data import/export utility. You will notice that the parameters, typed from the ADO connection utility, will be automatically entered into the edit box under the Select the data source button. Click the Next button to continue to step 3. Step 3/8: Select the table to import After having specified the data source, you must indicate which table contains the information to import. For example, if your data source is a relational database (such as Firebird, Oracle, MS SQL, etc.) the list of tables and views will be displayed. In the case of a spreadsheet (such as Excel of Lotus), the list of worksheets (tabs of the spreadsheet) will be displayed. Select the desired table to import from the drop down list, then click the Next button to continue to step 4. Step 4/8: Specify the NewWayService 4 database Now that you have indicated the data source, you must indicate in which database of NewWayService 4 you want the data to be imported. If you currently work only with one database, the connection parameters of this one will be automatically entered. If you have several NewWayService 4 databases (For example a production database and a test database) click the Select a connection from the list of existing connections button and select the desired connection. Note that the username and the password required at this step is the username and password of the Firebird database and not a technician code and password of NewWayService 4. When installing Firebird the first time, the default Firebird username who has administrative rights is SYSDBA and the password is masterkey (It’s important that the password masterkey be typed in lowercase). Usually, you don’t have to enter these information. By selecting a connection from the connection list, these information are automatically entered. Click the Next button to continue to step 5. Step 5/8: Technician code and password To be able to import data into a NewWayService 4 database, you must have administrative rights if the security of the selected NewWayService 4 database has been enabled. You do not need any right if the security of the selected NewWayService 4 database has not been enabled. In this case, the controls will be disabled. After entering a technician code who has administrative rights and a valid password, click the Next button to continue to step 6. If the security of the database has not been enabled, simply click the Next button to continue to the step 6. Step 6/8: Select the destination module where data will be imported As indicated previously, data can be imported into the following modules: - Products - Customers - Serial numbers - Spare parts - Articles (Knowledge base) - Suppliers

Page 9: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Importing data

Data import/export utility for NewWayService 4

6

Select the destination module where you want the data to be imported, then click the Next button to continue to step 7. As indicated previously, since adding work orders is a process which requires several validations, you cannot import work orders directly into NewWayService 4. However, users of NewWayService 3 can use the NewWayService 3 to NewWayService 4 data transfer utility included with NewWayService 4 to transfer all data to NewWayService 4 by a simple mouse click. A data transfer utility from NewWayService 2 to NewWayService 4 is also included with NewWayService 4. Importing data into the Products module : When importing products, be sure that the product code and the description of each imported product have a value. A product without code or without description will be automatically rejected. Other fields are also obligatory, but you will notice that you can set a default value for these fields from the drop down list. Also, each imported product must have a unique product code. If the products you want to import do not have unique product code, you can use the >> Generate automatically << option. This option will attempt to generate a unique code for each product imported. However, don’t use this option if you anticipate to import serial numbers which will be linked to these products. Importing data into the Customers module : When importing customers, be sure that the customer code and the name of each imported customer have a value. A customer without code or without name will be automatically rejected. Other fields are also obligatory, but you will notice that you can set a default value for these fields from the drop down list. Also, each imported customer must have a unique customer code. If the customers you want to import do not have unique customer code, you can use the >> Generate automatically << option. This option will attempt to generate a unique code for each customer imported. However, don’t use this option if you anticipate to import serial numbers which will be linked to these customers. Importing data into the Serial numbers module : When importing serial numbers, the following three fields are obligatory: Product code, Customer code and Serial number. Other fields are also obligatory, but you will notice that you can set a default value for these fields from the drop down list. For each imported record, the product code and the customer code must be equivalent to an existing product and customer code into the database. Also, each imported record must have a unique serial number. For example, if you want to import a file containing, at the same time, the information on your products, your customers and the serial numbers sold, start by importing your products and your customers. Then, you will be able to import your serial numbers since the product and customer codes will already exist into the database for each imported serial number. Don’t use the >> Generate automatically << option to import products and/or customers if you anticipate to import serial numbers which will be linked to these products and customers Importing data into the Spare parts module : When importing spare parts, be sure that the spare part code and the description of each imported spare part have a value. A spare part without code or without description will automatically be rejected. Other fields are also obligatory, but you will notice that you can set a default value for these fields from the drop down list.

Page 10: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Importing data

Data import/export utility for NewWayService 4

7

Also, each imported spare part must have a unique spare part code. If the spare parts you want to import don not have a unique spare part code, you can use the >> Generate automatically << option. This option will attempt to generate a unique code for each spare part imported. Importing data into the Articles (Knowledge base) module : When importing articles, be sure that the article code and the title of each imported article have a value. An article without code or without title will automatically be rejected. Other fields are also obligatory, but you will notice that you can set a default value for these fields from the drop down list. Also, each imported article must have a unique article code. If the articles you want to import do not have a unique article code, you can use the >> Generate automatically << option. This option will attempt

to generate a unique code for each article imported. Importing data into the Suppliers module : When importing suppliers, be sure that the supplier code and the name of each imported supplier have a value. A supplier without code or without name will automatically be rejected. Other fields are also obligatory, but you will notice that you can set a default value for these fields from the drop down list. Also, each imported supplier must have a unique supplier code. If the suppliers you want to import do not have a unique supplier code, you can use the >> Generate automatically << option. This option will attempt to generate a unique code for each supplier imported. Step 7/8: Associating source fields to destination fields At this step, you must specify which field from the source table will be transferred to each field of the destination module. When the association of the fields is done, click the Next button to continue to step 8. On the right side of the screen, you have all the fields available of the selected destination module and their type in parenthesis. The fields preceded by a star (*) indicate that they are obligatory.

The left part contains a drop down list for each destination field. It’s from this drop down list that you must specify which source field will be associated to each destination field. Each drop down list contains the list of source fields (preceded by the word Field_ and their type in parenthesis). Also, each drop down list can contain the following options: >> Generate automatically << This option is only available for the following fields: Product code, Customer code, Spare part code and Article code. For example, you can use this option if you are importing a list of products, and the imported products does not have a unique product code. By selecting this option, the data import/export utility will attempt to generate a unique code for each product imported.

Page 11: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Importing data

Data import/export utility for NewWayService 4

8

However, note that it is preferable to import a list of records which already have a unique code for each record instead of using this option. >> Use Script << This option allows you to write your own script in Object Pascal language instead of only associating a source field to a destination field. Example: You want to import data into the Customers module. Your source table contains the following four fields for the customer address information: Address 1, Address 2, City and Zip code. However, in the Customers module of NewWayService 4, only one field is necessary to enter all information about the customer address. Since from the drop down list you can only select one source field for each destination field, you cannot indicate that you want these four fields to be associated to the unique destination field (The field Address of the Customers module). To handle this situation, you can use a script instead of only associating a source field to a destination field. By selecting the >> Use Script << option, the Script… button at the right of the drop down list will become enabled. Click on this button to be able to write your script. Here is an example of a script, which indicate to associate the source fields Address 1, Address2, City and Zip code to the Address destination field of the Customers module : begin ImportValue := Field_Address1 + #13#10 + Field_Address2 + #13#10 + Field_City + ' ' + Field_ZipCode; end;

The Address field of the Customers module of NewWayService 4 is a field of type Memo. A “Memo” field allows users to enter many lines of text. So, you will notice that the #13#10 characters have been used into this script. These characters indicate to insert carriage return between some fields to be able to get the information on many lines. For example, if the fields had these values: Address 1: 99, Demers Avenue Address 2: Suite 123 City: Montreal Zip code: H3A 1Y2 The result would be: 99, Demers Avenue Suite 123 Montreal H3A 1Y2

For more information about using scripts, refer to the Use of scripts using the Object Pascal language and Object Pascal reference sections. >> Do not import << Select this option if you don’t want to assign anything to some destination fields.

Page 12: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Importing data

Data import/export utility for NewWayService 4

9

Status, categories and zones In addition to options mentioned previously, each drop down list can contain, in some cases, the list of status (Active and Inactive), the list of customer categories, product categories, spare part categories, article categories and zones, corresponding to the selected NewWayService 4 database. For example, when importing data to the Customers module, the drop down list corresponding to the Category code would contain, in addition to the list of source fields, the list of all customer categories available into the database. Then, you could select directly an existing category for this field. Step 8/8: Last parameters and starting the import process This step is the last step before starting the import process. Indicate if you want to erase all records of the specified destination module before the import process. Note that if you check this option, only records that are not linked to any work orders or other modules will be erased. Other records will not be erased. For example, if you import a list of customers and you check the option Erase all existing customers before the import process, customers linked to work orders, serial numbers, documents or any other

modules will not be erased. You must also specify what you want the data import/export utility do when an existing record (same code) is processed. Then, if you want to save all the import parameters entered, check the option Save parameters of this import process for future use and type a file name where parameters

will be saved. This option is also useful if you want to automate the import process from a command file (BATCH file) or from a tasks scheduler software. Refer to the Automating the import/export process section for more information.

Now, click on the Start import button to start the import process. While importing data, if errors are

encountered, they will be displayed on screen. Also, a summary of the import process will be displayed at the end of the operation. Note that you can stop an import process at anytime by clicking the Stop button. If you stop the import

process before it is finished, no information will be saved to the database. If errors are encountered while the import process, please change your import parameters and try again. In most cases, the errors encountered are data errors. Here is a list of common errors encountered during an import process: - Incompatible data type (Ex. : Trying to assign a String to a Date or Integer field). - Value out of limit (Ex. : Trying to assign a value other than 0 (Inactive) or 1 (Active) to a Status field or

trying to assign a non-existent category number to a category field).

Page 13: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Importing data

Data import/export utility for NewWayService 4

10

- Script error which causes the reject of the record. The data import/export utility for NewWayService 4 is very flexible and very powerful, especially because of the many possibilities that scripts offer. Moreover, the use of Microsoft ADO technology makes possible access to most of the database on the market. Since a multitude of possibilities are available through this utility, they cannot all be tested. If you get problems accessing some database types, we recommend you to verify your database connection parameters. Also, refer to the documentation of the database you try to access. After these verifications, if you still get problems accessing your specific database, refer to the Technical support section of the NewWayService 4 installation guide to know how to get support. However, it is important to note that since there is a lot of different kinds of databases available on the market, we cannot certify that the data import/export utility will be 100% compatible with each of these databases.

Page 14: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Exporting data

Data import/export utility for NewWayService 4

11

Exporting data

Introduction This section explains how to export data from NewWayService 4 to an external file or another database. There is no limit about data to be exported. All the data of NewWayService 4 can be exported. Note that in addition to all functionalities the data import/export utility provides you, all reports of NewWayService 4 are also exportable in many file formats. Refer to the document Reports Generator for NewWayService 4 for more information about exporting reports.

Exporting data, step by step Step 1/8: What do you want to do ? This step allows you to load a file containing export parameters previously saved in a previous export process. This is very useful when you export always the same data, on a regular basis. This avoid you to reenter export parameters each time. If it’s the first time you export data with this utility, select Start a new data export, then click the Next button to continue to step 2. If you want to load parameters of a previous export process, select Export data from previously saved parameters, then select the file containing your export parameters by using the … button. Click the Next button to continue to step 2. Step 2/8: Specify the NewWayService 4 database You must specify from which NewWayService 4 database you want the data to be exported. If you currently work with only one database, the connection parameters of this one will be automatically entered. If you have many NewWayService 4 databases (For example a production database and a test database), click the button Select a connection from the list of existing connections and select the desired connection. Note that the username and the password required at this step are the username and password of the Firebird database and not a technician code and password of NewWayService 4. When installing Firebird the first time, the default Firebird username who as the administrative rights is SYSDBA and the password is masterkey (It’s important to type the password masterkey be typed in lowercase). Usually, you do not

Page 15: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Exporting data

Data import/export utility for NewWayService 4

12

have to enter these information. By selecting a connection from the connection list, those information are automatically entered. Click the Next button to continue to step 3. Step 3/8: Technician code and password To be able to export data from a NewWayService 4 database, you must have the administrative rights if the security of the selected NewWayService 4 database has been enabled. You don’t need any right if the security of the selected NewWayService 4 database has not been enabled. In this case, the controls will be disabled. After entering a NewWayService 4 technician code having the administrative rights and a valid password, click the Next button to continue to step 4. If the security of the database has not been enabled, simply

click the Next button to continue to the step 4. Step 4/8: Select data to export At this step, you must specify which data you want to export (for example, the list of customers). The data selection is performed by using a SQL query. SQL (Structured Query Language) is a universal language used to communicate with a database. SQL is an easy language but if you are not familiar with this language, and you want to build your own query for exporting data, we recommend you to refer to one of many works on this subject. If you don’t know the SQL language, no problem. Several SQL queries for data export are already included with the data import/export utility. Click the button Select a predefined query to select a query from

the list. Here are some of the queries already included. Customers.sql Use this query to export the list of customers. Products.sql Use this query to export the list of products. Work_orders.sql Use this query to export the list of work orders. Actions.sql Use this query to export the list of actions on each work order. You can also modify a predefined query, according to your needs. For example, the following query indicates to export the product code and the description of your products : SELECT PROCODDES, PRODES FROM PRO; By using the query above, all products will be included into the query. By adding a condition to this query, you can indicate that you only want the active products : SELECT PROCODDES, PRODES FROM PRO WHERE PROSTA = 1; To verify that your query is working fine and extract the desired information, click the button Test query. If the query is working fine, the result of the query will be displayed in the grid. Else, an error message will be displayed, indicating that the query cannot be executed. You can click the More info… button to know exactly what was the problem encountered during the execution of the query. When you have finished to enter your query and the test was successful, click the Next button to continue to step 5.

Page 16: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Exporting data

Data import/export utility for NewWayService 4

13

Step 5/8: Select the destination of exported data This step allows you to specify where the data will be exported. If you want to export data to an MS Access, dBase or MS Excel file, simply select the file by using the … button then, click the Next button to continue to step 6. Note that if the selected file does not exist, it will be automatically created at the export process. Also, you can choose a specific file format from the drop down list. For example, for an MS Access file, you can create an MS Access 2000, MS Access 97, MS Access 7.0 or MS Access 2.0 file. You can also specify the file format even if you are exporting data to an existing file. If you want to export your data to another file format or a more sophisticated database, select the option another destination (Other file types, SQL databases, ODBC, etc.). Note that in this case, the destination where data will be exported must exist. Then, click Select data destination to display the ADO connection utility. Then, click the Build button to access the different tabs.

The ADO connection utility can differ, depending on the ADO and/or Windows version you currently use. From the utility, select the data destination type you want to access (usually from the Provider tab) then, type the connection parameters, specific to your data destination (usually from the Connection tab). The list of providers available from the ADO connection utility (Provider tab) can differ between computers, depending on the ADO and/or Windows version used and software installed. As indicated previously, visit the ADO section of the Microsoft web site at http://www.microsoft.com/data/ for more information and/or download the latest version of the MDAC. A few examples of providers that can be available: The Microsoft Jet 4.0 OLE DB Provider is usually available and is used to access data file such as MS Access, MS Excel, dBase, Lotus, Exchange, Paradox, Text, Html or any other file format that Microsoft could add. The Microsoft OLE DB Provider for SQL server provider should be available if you currently use the MS SQL database server into your organization and that the MS SQL client software has been installed on your computer. Use this provider to access a MS SQL database. The Microsoft OLE DB Provider for ODBC Drivers provider is also usually available. Use this provider to access a data through an ODBC driver.

Page 17: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Exporting data

Data import/export utility for NewWayService 4

14

As you can see, ADO allows you to access most of the databases available on the market. However, the configuration process of the connection can differ, depending on the type of data you try to access. Please, refer to your database documentation to enter correct ADO connection parameters. The assistance of your database administrator is also strongly recommended. When all ADO connection parameters have been entered, click the button Test connection to verify the connection to your data destination. If the connection test is successful, click the OK button to close the ADO connection utility and to return to the data import/export utility. You will notice that parameters typed from the ADO connection utility will be automatically entered into the edit box, under the Select the data destination button. Click the Next button to continue to step 6. Step 6/8: Select the destination table After having specified the data destination, you must indicate the table into which the data will be exported. For example, if your data destination is a relational database (such as Firebird, Oracle, MS SQL, etc.), the list of tables will be displayed. In the case of a spreadsheet (such as Excel), the list of worksheets (tabs of the spreadsheet) will be displayed. Note that if you are exporting data to a file such as MS Access, dBase or MS Excel, if you specify a table name that does not exist, the structure of the table created will contain the list of fields of your SQL query. From the drop down list, select the desired table where you want data to be exported to, then click the Next button to continue to step 7. Step 7/8: Associating source fields to destination fields At this step, you must specify which field of the source query will be transferred, for each field of the destination table. When the fields association is done, click the Next button to continue to step 8. On the right side of the screen, you have all fields available of the selected destination table and their type in parenthesis.

The left part contains a drop down list for each destination field. It’s from this drop down list that you must specify which source field will be associated to each destination field. Each drop down list contains the list of fields of the query you entered at step 4 (preceded by the word Field_ and their type in parenthesis). Also, each drop down list can contain the following options : >> Use Script << This option allows you to write your own script in Object Pascal language, instead of only associating a source field to a destination field. Example: You want to export the list of your customers. Into your query, you have the CUSSTA field which indicates the customer status. 0 for inactive and 1 for active. However,

Page 18: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Exporting data

Data import/export utility for NewWayService 4

15

into your destination table, you want to write AC for active and IN for inactive instead of 1 or 0. Since from

the drop down list you cannot do that, you can instead use a script to get the expected result. By selecting the >> Use Script << option, the Script… button at the right of the drop down list will become enabled. Click on this button to be able to write your script. Here is an example of a script, indicating to associate AC for active customers and IN for inactive customers

to the Status destination field. begin If Field_CUSSTA = 1 Then ExportValue := 'AC' Else ExportValue := 'IN'; end;

For more information about using scripts, refer to the sections Use of scripts using the Object Pascal language and Object Pascal reference. >> Do not export << Select this option if you don’t want to assign anything to some destination fields. Step 8/8: Last parameters and starting the export process This step is the last step before starting the export process. Here, you can specify if you want to erase all the records of the specified destination table before the export process. If you don’t want to erase all the records before the export process, you can select one of the following three options: Append records to destination table If you select this option, all exported records will be simply appended to the destination table. Append records to destination table but update existing records that match the key If you select this option, all exported records whose the key does not exist into the destination table will be appended. If the value of the key fields is found, the information of the record will be updated. If you select this option, you must select at least one key field which will be used to verify that the record exists into the destination table. If you select more than one field, all selected fields will constitute the key. Update only existing records that match the key. If you select this option, only exported records whose the key fields exist into the destination table will be updated. No new records will be append to the destination table. If you select this option, you must select at least one key field which will be used to verify that the record exists into the destination table. If you select more than one field, all selected fields will constitute the key. Thereafter, if you want to save all the export parameters you entered, check the option Save parameters of this export process for future use and type a file name where parameters will be saved.

This option is also useful if you want to automate the export process from a command file (BATCH file) or from a tasks scheduler software. Refer to the section Automating the import/export process for more information.

Page 19: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Exporting data

Data import/export utility for NewWayService 4

16

Now, click the Start export button to export your data. While exporting data, if errors are encountered,

they will be displayed on screen. Also, a summary of the export process will be displayed at the end of the operation. Please, note that you can stop an export process at anytime by clicking the Stop button. If you stop the export process before it is finished, the data import/export utility will attempt to cancel changes made to the destination table by doing a rollback of the transaction. IMPORTANT : If your destination database handle transactions (such as Firebird, MS SQL and Oracle databases), and you stop manually the export process, changes made to the database should be automatically cancelled. However, if your destination database does not handle transactions (such as MS Access or MS Excel files), the records already added and/or updated could not be cancelled. If errors are encountered during the export process, please change your export parameters and try again. In most cases, the kind of errors encountered are data errors. Here is a list of common errors encountered during an export process: - Incompatible data type (Ex. : Trying to assign a String to a Date or Integer field). - Script error which causes the reject of the record. The data import/export utility for NewWayService 4 is very flexible and very powerful, especially because of the many possibilities that scripts offer. Moreover, the use of Microsoft ADO technology makes possible the access to most of the databases on the market. Since a multitude of possibilities are available through this utility, all the possibilities cannot be tested. If you get problems accessing some database types, we recommend you to verify your database connection parameters. Also, refer to the documentation of the database you try to access. After these verifications, if you still get problems accessing your specific database, refer to the Technical support section of the NewWayService 4 installation guide to know how to get support. However, it is important to note that since there is a lot of different kinds of databases available on the market, we cannot certify that the data import/export utility will be 100% compatible with each of these databases.

Page 20: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Use of scripts using the Object Pascal language

Data import/export utility for NewWayService 4

17

Use of scripts, using the Object Pascal language As discussed briefly in the sections Importing data and Exporting data, it’s possible to write scripts to satisfy specific needs such as field formatting, field concatenation, etc. Most of the time, scripts have only one or a few lines of code. However, in some cases, it could happen that you need to write scripts with several lines of code.

You can enter a different script for each field to import or export. Each script of each field is executed for each imported/exported record. For example, if you want to import a list of 50 customers, for most of the fields, you decide to simply assign source fields to destination fields, but for the Address field of the destination module, you decide to use a script. Since you have 50 customers (50 records) to import, the script you entered for the Address field will be executed 50 times, so 1 time for each record. Here is the main information you need to be able to write scripts using the Object Pascal language. If you are not familiar with general programming, we recommend you to ask somebody who knows about general programming to help you. This chapter is not a programming course in Object Pascal language but the main information needed to be able to write scripts that will run correctly with the data import/export utility. For more information about Object Pascal language, refer to the section Object Pascal language reference below. Script editor The script editor is displayed when you click the Script… button, located next to each field at step 7 of an import or export process. Enter your script in the box available for this purpose. You should also notice some tabs. The Source fields tab contains the list of source fields available when importing or exporting data. The Variables tab contains some useful variables you can use into

your scripts (See the section Variables available below). When entering scripts, it’s not obligatory to enter the name of source fields of variables manually. You can simply position your cursor into the editor box, at the place where you want to insert the field or variable name, then click the desired field or variable, drag the mouse into the editor box (drag/drop) then, release the mouse button. The name of the selected object will be automatically entered at the cursor position. If some text in the editor is selected, it is automatically replaced.

Page 21: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Use of scripts using the Object Pascal language

Data import/export utility for NewWayService 4

18

When your script is done, you can click the Verify syntax button to verify that the script does not contain any error. Click the OK button to save and quit the script editor or click the Cancel button if you don’t want to save your changes. General syntax A script always begins with the word begin and is always terminated by the word end; (the semicolon

following the word end is important and must be present). Also, each line of code must end with a semicolon ;. Example 1: begin ImportValue := Trim(Field_CustomerName); end;

You can declare variables into a script by using the word var . The word var must precede the word

begin. You can also declare constants by using the word const. The word const must precede the word

var if you also declare variables, else the word const must precede the word begin . Example 2: var CusName: String; begin CusName := Trim(Field_CustomerName); ImportValue := CusName; end;

Example 3 : const CARRIAGE_RETURN = #13#10; var Address: String; begin Address := Field_Address1 + CARRIAGE_RETURN + Field_City + CARRIAGE_RETURN + Field_ZipCode; ImportValue := Address; end;

You can also declare procedures and functions into a script by using the words procedure and function. Example 4 : Function StatusText: String; begin If Field_CUSSTA = 1 Then

Page 22: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Use of scripts using the Object Pascal language

Data import/export utility for NewWayService 4

19

Result := 'Active' Else Result := 'Inactive'; end; var MyStatus: String; begin MyStatus := StatusText; ExportValue := MyStatus; end;

Variables available : When writing scripts, the following variables are available: The variable RecordNumber, of Integer type, indicate the current record number processed. The value of

this variable is 1 for the first record, 2 for the second one, etc. The variable SkipRecord, of Boolean type, allows you to skip records when importing or exporting data.

The default value of this variable is False, indicating not to skip the record (so the record will be imported or exported as the case may be). The variable ImportValue (only available when importing data) is used to indicate the final value of the

destination field. The type of this variable is automatically adjusted, depending on the type of the imported field. For example, this variable will have a String type if the script you are entering is for a field of String type, an Integer type if the field is an Integer, and so on. You must always assign the final value to this variable, when writing import scripts. The variable ExportValue (only available when exporting data) is used to indicate the final value of the destination field. The type of this variable is automatically adjusted, depending on the type of the exported field. For example, this variable will have a String type if the script you are entering is for a field of String type, an Integer type if the field is an Integer, and so on. You must always assign the final value to this variable, when writing export scripts. The following example is a script used when exporting a list of customers. The final value is assigned to the variable ExportValue. Also, a condition is set to verify the status of the customer. If the status is 1 (active) we export the customer, else we skip this customer record. By assigning the value True to the SkipRecord variable, this indicates to the data import/export utility to skip this record, so the record will not

be exported. Note also the special characters // into the script. These characters are used to add comment

lines to the script. These lines are not taken into account when the script is executed. begin // If the customer is inactive, we don’t export the record If Field_CUSSTA = 0 Then SkipRecord := True; ExportValue := Field_CUSNAM; end;

More information Refer to the section Object Pascal language reference below for more information on Object

Pascal language elements you can use when writing scripts. For information on general programming concepts, refer to one of many works on this subject.

Page 23: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Object Pascal language reference

Data import/export utility for NewWayService 4

20

Object Pascal language reference

Object Pascal language overview Object Pascal is a language derived from the Pascal and oriented object. This language is used with the development software Delphi from Borland Corporation. You must use the syntax and elements of the Object Pascal language to write scripts into the data import/export utility for NewWayService 4. Even if most of the Object Pascal language elements are recognized when writing scripts into the data import/export utility, here below are the main elements available which you can use: Please note that even if the Object Pascal language is relatively simple to learn, this chapter is only a reference to main elements of this language. If you are not already familiar with Object Pascal language, we recommend you to refer to one of many works on this subject or to the Delphi development software. Statements: Case If–then If–then–else For Repeat While Data types: Boolean Currency Double Extended Integer Word Single Char String TDateTime Variant Set Array Operators: Assignment (:=) Boolean (and, not, or, xor) Class (as, is) Math (-, +, *, /, div, mod) Relational (<, <=, <>, =, >, >=) String (+) Unary (-, +)

Page 24: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Object Pascal language reference

Data import/export utility for NewWayService 4

21

Standard routines String functions CompareText Declaration function CompareText(const S1, S2: String): Integer; Description Compares two strings by ordinal value without case sensitivity. Copy Declaration function Copy(S: String; Index, Count: Integer): String; Description Returns a substring of a string or a segment of a dynamic array. Delete Declaration procedure Delete(var S: String; Index, Count: Integer); Description Removes a substring from a string. Insert Declaration procedure Insert(Source: String; var S: String; Index: Integer); Description Inserts a substring into a string beginning at a specified point. Length Declaration function Length(S: String): Integer; Description Returns the number of characters in a string. LowerCase Declaration function LowerCase(const S: String): String; Description Converts an ASCII string to lowercase. Pos Declaration function Pos(Substr: String; S: String): Integer;

Page 25: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Object Pascal language reference

Data import/export utility for NewWayService 4

22

Description Returns the index value of the first character in a specified substring that occurs in a given string. Trim Declaration function Trim(const S: String): String; Description Returns a copy of the string S with leading spaces, trailing spaces and control characters removed.

TrimLeft Declaration function TrimLeft(const S: String): String; Description Returns a copy of the string S with leading spaces and control characters removed.

TrimRight Declaration function TrimRight(const S: String): String; Description Returns a copy of the string S with trailing spaces and control characters removed. UpperCase Declaration function UpperCase(const S: String): String; Description Returns a copy of a string in uppercase. Conversion functions Chr Declaration function Chr(X: Byte): Char; Description Returns the character with the ordinal value (ASCII value) of the byte-type expression, X. CurrToStr Declaration function CurrToStr(Value: Currency): String; Description Formats a Currency value as a string. DateTimeToStr Declaration

Page 26: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Object Pascal language reference

Data import/export utility for NewWayService 4

23

function DateTimeToStr(aDateTime: DateTime): String; Description Converts a TDateTime value to a string. DateToStr Declaration function DateToStr(aDate: Date): String; Description Converts a TDateTime value to a string. FloatToStr Declaration function FloatToStr(Value: Extended): String; Description Converts a floating point value to a string. IntToStr Declaration function IntToStr(Value: Integer): String; Description Converts an integer to a string. StrToCurr Declaration function StrToCurr(const S: String): Currency; Description Converts a string to a Currency value. StrToDate Declaration function StrToDate(const S: String): Date; Description Converts a string to a TDateTime value. StrToDateTime Declaration function StrToDateTime(const S: String): DateTime; Description Converts a string to a DateTime value. StrToFloat Declaration

Page 27: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Object Pascal language reference

Data import/export utility for NewWayService 4

24

function StrToFloat(const S: String): Extended; Description Converts a given string to a floating-point value. StrToInt Declaration function StrToInt(const S: String): Integer; Description Converts a string that represents an integer (decimal or hex notation) to a number. StrToTime Declaration function StrToTime(const S: String): Time; Description Converts a string to a TDateTime value. TimeToStr Declaration function TimeToStr(aTime: Time): String; Description Returns a string that represents a TDateTime value. Format functions FormatCurr Declaration function FormatCurr(const Format: String; Value: Currency): String; Description Formats a Currency object. See FormatFloat function for more information on supported formats. FormatDateTime Declaration function FormatDateTime(const Format: String; aDateTime: DateTime): String; Description Formats a DateTime value. The following format specifiers are supported (See Windows help for more information about date and time formats): Specifier: C Displays the date by using the format given by the Windows short date format, followed by the time using the format given by the Windows long time format. The time is not displayed if the fractional part of the DateTime value is zero.

Page 28: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Object Pascal language reference

Data import/export utility for NewWayService 4

25

d Displays the day as a number without a leading zero (1-31). dd Displays the day as a number with a leading zero (01-31). ddd Displays the day as an abbreviation (Sun-Sat). dddd Displays the day as a full name (Sunday-Saturday). ddddd Displays the date using the format given by the Windows short date format. dddddd Displays the date using the format given by the Windows long date format. m Displays the month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed. mm Displays the month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed. mmm Displays the month as an abbreviation (Jan-Dec). mmmm Displays the month as a full name (January-December). yy Displays the year as a two-digit number (00-99). yyyy Displays the year as a four-digit number (0000-9999). h Displays the hour without a leading zero (0-23). hh Displays the hour with a leading zero (00-23). n Displays the minute without a leading zero (0-59). nn Displays the minute with a leading zero (00-59). s Displays the second without a leading zero (0-59). ss Displays the second with a leading zero (00-59).

Page 29: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Object Pascal language reference

Data import/export utility for NewWayService 4

26

z Displays the millisecond without a leading zero (0-999). zzz Displays the millisecond with a leading zero (000-999). t Displays the time using the format given by the Windows short time format. tt Displays the time using the format given by the Windows long time format. am/pm Uses the 12-hour clock for the preceding h or hh specifier, and displays 'am' for any hour before noon, and 'pm' for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly. a/p Uses the 12-hour clock for the preceding h or hh specifier, and displays 'a' for any hour before noon, and 'p' for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly. ampm Uses the 12-hour clock for the preceding h or hh specifier, and displays the contents of the Windows AM symbol for any hour before noon, and the contents of the Windows PM symbol for any hour after noon. / Displays the date separator character given by the Windows date separator. : Displays the time separator character given by the Windows time separator. 'xx'/"xx" Characters enclosed in single or double quotes are displayed as-is, and do not affect formatting. Format specifiers may be written in upper case as well as in lower case letters--both produce the same result. If the string specified by the Format parameter is empty, the TDateTime value is formatted as if a 'c' format specifier had been given. Example: The following example assigns 'The meeting is on Wednesday, February 15, 1995 at 10:30 AM' to the string variable S. S := FormatDateTime('"The meeting is on " dddd, mmmm d, yyyy, " at " hh:mm AM/PM', StrToDateTime('2/15/95 10:30am'));

FormatFloat Declaration function FormatFloat(const Format: String; Value: Extended): String; Description Formats a floating point value. The following format specifiers are supported (See Windows help for more information about number and currency formats) :

Page 30: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Object Pascal language reference

Data import/export utility for NewWayService 4

27

0 Digit place holder. If the value being formatted has a digit in the position where the '0' appears in the format string, then that digit is copied to the output string. Otherwise, a '0' is stored in that position in the output string. # Digit placeholder. If the value being formatted has a digit in the position where the '#' appears in the format string, then that digit is copied to the output string. Otherwise, nothing is stored in that position in the output string. . Decimal point. The first '.' character in the format string determines the location of the decimal separator in the formatted value; any additional '.' character is ignored. The actual character used as a the decimal separator in the output string is determined by the Windows decimal separator specified in the Number Format of the International section in the Windows Control Panel. , Thousands separator. If the format string contains one or more ',' characters, the output will have thousands separators inserted between each group of three digits to the left of the decimal point. The position and number of ',' characters in the format string does not affect the output, except to indicate that thousands separators are wanted. The actual character used as a the thousands separator in the output is determined by the Windows thousands separator, specified in the Number Format of the International section in the Windows Control Panel. E+ Scientific notation. If one of the strings 'E+', 'E-', 'e+', or 'e-' is contained in the format string, the number is formatted using scientific notation. A group of up to four '0' characters can immediately follow the 'E+', 'E-', 'e+', or 'e-' to determine the minimum number of digits in the exponent. The 'E+' and 'e+' formats cause a plus sign to be output for positive exponents, and a minus sign to be output for negative exponents. The 'E-' and 'e-' formats output a sign character only for negative exponents. 'xx'/"xx" Characters enclosed in single or double quotes are output as-is, and do not affect formatting. ; Separates sections for positive, negative, and zero numbers in the format string. The locations of the leftmost '0' before the decimal point in the format string and the rightmost '0' after the decimal point in the format string determine the range of digits that are always present in the output string. The number being formatted is always rounded to as many decimal places as there are digit placeholders ('0' or '#') to the right of the decimal point. If the format string contains no decimal point, the value being formatted is rounded to the nearest whole number. If the number being formatted has more digits to the left of the decimal separator than there are digit placeholders to the left of the '.' character in the format string, the extra digits are output before the first digit placeholder. To allow different formats for positive, negative, and zero values, the format string can contain between one and three sections separated by semicolons. - One section: The format string applies to all values. - Two sections: The first section applies to positive values and zeros, and the second section applies to

negative values.

Page 31: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Object Pascal language reference

Data import/export utility for NewWayService 4

28

- Three sections: The first section applies to positive values, the second applies to negative values, and the third applies to zeros.

If the section of negative values or the section of zero values is empty, (if there is nothing between the semicolons that delimit the section), the section of positive values is used instead. The following table shows a few sample formats and the results produced when the formats are applied to different values: Format string 1234 -1234 0.5 0 0 1234 -1234 1 0 0.00 1234.00 -1234.00 0.50 0.00 #.## 1234 -1234 .5 #,##0.00 1,234.00 -1,234.00 0.50 0.00 #,##0.00;(#,##0.00) 1,234.00 (1,234.00) 0.50 0.00 #,##0.00;;Zero 1,234.00 -1,234.00 0.50 Zero 0.000E+00 1.234E+03 -1.234E+03 5.000E-01 0.000E+00 #.###E-0 1.234E3 -1.234E3 5E-1 0E0 DateTime functions Date Declaration function Date: DateTime; Description Returns the current date. DayOfWeek Declaration function DayOfWeek(aDate: DateTime): Integer; Description Returns the day of the week of the specified date as an integer between 1 and 7, where Sunday is the first day of the week and Saturday is the seventh. DecodeDate Declaration procedure DecodeDate(aDate: DateTime; var Year, Month, Day: Word); Description Breaks the value specified as the Date parameter into Year, Month, and Day values. If the given DateTime value is less than or equal to zero, the year, month, and day return parameters are all set to zero. DecodeTime Declaration procedure DecodeTime(aTime: DateTime; var Hour, Min, Sec, MSec: Word); Description Breaks a DateTime value into hours, minutes, seconds, and milliseconds.

Page 32: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Object Pascal language reference

Data import/export utility for NewWayService 4

29

EncodeDate Declaration function EncodeDate(Year, Month, Day: Integer): DateTime; Description Returns a DateTime value from the values specified as the Year, Month, and Day parameters. The year must be between 1 and 9999. Valid Month values are 1 through 12. Valid Day values are 1 through 28, 29, 30, or 31, depending on the Month value. For example, the possible Day values for month 2 (February) are 1 through 28 or 1 through 29, depending on whether or not the Year value specifies a leap year. EncodeTime Declaration function EncodeTime(Hour, Min, Sec, MSec: Integer): DateTime; Description Encodes the given hour, minute, second, and millisecond into a DateTime value. Valid Hour values are 0 through 23. Valid Min and Sec values are 0 through 59. Valid MSec values are 0 through 999. Now Declaration function Now: DateTime; Description Returns the current date and time. Math functions ArcTan Declaration function ArcTan(X: Extended): Extended; Description Calculates the arctangent of a given number. Cos Declaration function Cos(X: Extended): Extended; Description Calculates the cosine of an angle. Cosh Declaration function Cosh(X: Extended): Extended; Description Calculates the hyperbolic cosine of an angle.

Page 33: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Object Pascal language reference

Data import/export utility for NewWayService 4

30

Cotan Declaration function Cotan(X: Extended): Extended; Description Calculates the cotangent of an angle. Exp Declaration function Exp(X: Extended): Extended; Description Returns the exponential of X. Frac Declaration function Frac(X: Extended): Extended; Description Returns the fractional part of a real number. Int Declaration function Int(X: Extended): Extended; Description Returns the integer part of a real number. IntPower Declaration function IntPower(Base: Extended; Exponent: Integer): Extended; Description Calculates the integral power of a base value. Ln Declaration function Ln(X: Extended): Extended; Description Returns the natural log of a real expression. Power Declaration function Power(Base, Exponent: Extended): Extended; Description Raises Base to any power.

Page 34: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Object Pascal language reference

Data import/export utility for NewWayService 4

31

Round Declaration function Round(X: Extended): Integer; Description Returns the value of X rounded to the nearest whole number. Sin Declaration function Sin(X: Extended): Extended; Description Returns the sine of the angle in radians. Sqr Declaration function Sqr(X: Extended): Extended; Description Returns the square of a number. Sqrt Declaration function Sqrt(X: Extended): Extended; Description Returns the square root of X. Tan Declaration function Tan(X: Extended): Extended; Description Returns the tangent of X. Tanh Declaration function Tanh(X: Extended): Extended; Description Returns the hyperbolic tangent of X. Trunc Declaration function Trunc(X: Extended): Integer; Description Truncates a real number to an integer.

Page 35: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Object Pascal language reference

Data import/export utility for NewWayService 4

32

Other useful functions ShowMessage Declaration procedure ShowMessage(const Msg: string); Description Displays a message box with an OK button. The Msg parameter is the message string that appears in the message box. Useful to make a trace when running a script. WARNING: Do not use this procedure if you are planing to use the script in automatic mode. For example, when running the script in background from a task scheduler or the schedule service of Windows, else the ShowMessage procedure will stop the script execution.

Page 36: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Automatic data import/export

Data import/export utility for NewWayService 4

33

Automatic data import/export As discussed previously, you can save your import or export parameters for a future use. During a future import or export process, you will not have to reenter your parameters. Instead, you will only have to indicate to the data import/export utility that you want to load a parameters file previously saved, and all your parameters will be automatically loaded. It is very useful when you want to import and/or export data on a regular basis. For example, if every day you want to import the list of all new customers and update existing ones from your accounting software, you only have to enter import parameters once, the first time, then save these parameters into a file. Next times, you will be able to load these parameters to run your customers import process. In addition to allowing you to load previously saved import/export parameters, the data import/export utility allows you to execute an import or export process without any user intervention. You can run the data import/export utility and specify, as a parameter, a filename containing your import or export parameters. By doing this, the data import/export utility will execute the import or export process (as the case may be), then will automatically end after the import or export is finished. It is very useful when you want to import or export data, for example, over the night and on a regular basis. You can run the data import/export utility from command files (batch files) or any task scheduler software such as the Windows task scheduler or the Schedule service. Parameter –IMPORT Use this parameter to indicate to the data import/export utility that you want to run an import process from the specified import parameters file. Parameter –EXPORT Use this parameter to indicate to the data import/export utility that you want to run an export process from the specified export parameters file. Parameter –LOG Use this parameter to indicate to the data import/export utility that you want to save the log of the import/export process to a specific file. If this parameter is not specified, the data import/export utility will automatically save the log into the same folder where the data import/export utility (IMEX.EXE) is located. In the case of an import process, the file will be named import.log and in the case of an export process, the file will be named export.log. Here are some examples of calling the program IMEX.EXE (The data import/export utility). You must use the quotation marks character when there is spaces into the file name of folder name: Example 1 : imex.exe –import=customers.nix

Example 2 : imex.exe –export=c:\export\parts.nix

Example 3 : imex.exe –export=parts.nix –log="C:\My Documents\Log\import_parts.log"

Example 4 :

Page 37: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Automatic data import/export

Data import/export utility for NewWayService 4

34

"C:\Program Files\OroLogic\NewWayService4\imex.exe" –export=c:\import\parts.nix –log="C:\My Documents\Log\import_parts.log"

Page 38: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Data dictionary

Data import/export utility for NewWayService 4

35

Data dictionary

List of entities of the NewWayService 4 database Refer to the DIC.XLS document (Microsoft Excel format) included with NewWayService 4 and available in the installation folder (usually C:\Program Files\OroLogic\NewWayService4) to know the list of tables and fields of NewWayService 4.

Page 39: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Tutorials

Data import/export utility for NewWayService 4

36

Tutorials This section introduces you 4 tutorials that you may follow, step by step, to learn how to use the data import/export utility.

Tutorial 1 – Importing products This tutorial shows you, step by step, how to import a list of products from an Excel file. 1- Start the data import/export utility. 2- Select the Import data to NewWayService 4 option from the radio button, then click the Start button. 3- Select Start a new data import option from the radio button, then click the Next button. 4- From the Import data from group, select a file (Excel, Access, dBase, etc.), then click the … button at the right side of the filename edit box. From the dialog box, select the Excel files (*.xls) file type. Select the file tutorial.xls located in the installation folder usually C:\Progam Files\OroLogic\NewWayService4, then click the Open button. Click the Next button. 5- From the drop down list, select the Products$ table, then click the Next button. 6- Leave connection parameters already entered to connect to your default NewWayService 4 database or change these parameters to connect to another NewWayService 4 database. Then, click the Next button. 7- If the security is enabled into the selected NewWayService 4 database, enter a valid technician code and password (a technician code who has administrative rights), then click the Next button. Click directly the Next button if the security is not enabled. 8- From the Import to group, select Products then click Next. 9- From the first drop down list, on the left side of the field * Product code (String), select Field_CODE (String). From the second drop down list, on the left side of the field * Description (String), select Field_DESCRIPTION (String). From the third drop down list, on the left side of the

field * Category code (Integer), select a category (for example 1 (Default)). Click the Next button. 10- As last parameters, check the option Save parameters of this import process for future use, then select a file name where the parameters of this import process will be saved. Leave the other

parameters as default, then click the Start import button. When the program asks you Are you sure you want to start the import process?, click Yes. 11- After the import process, you should have a summary of the import process, indicating you that 5 records has been added (The Products tab of the Excel file contains 5 products). 12- Click the Close button, then quit the data import/export utility.

13- Run NewWayService 4, verify that you have 5 new products, then quit NewWayService 4.

Page 40: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Tutorials

Data import/export utility for NewWayService 4

37

14- Open the Excel file you imported (the tutorial.xls file located in the C:\Program Files\OroLogic\NewWayService4 folder) with your spreadsheet software. 15- Modify the description MY PRODUCT 1 to MY PRODUCT TEST. 16- Save your changes, then quit your spreadsheet software. 17- Run the data import/export utility again, then select the option Import data to NewWayService 4 from the radio button, then click Start. 18- Now, instead of selecting the option Start a new data import, select the option Import data from previously saved parameters, then select the file containing the import parameters you saved

at step 10 of this tutorial and click the Next button. 19- If you do not want to change any parameter, click the Next button until you reach the last step, then click the Start import button. After the import process, you should have a summary of the import

process indicating that 5 records have been updated. Since product codes already exist into the database, these products have been updated. Quit the data import/export utility. 20- Run NewWayService 4, then verify that the description of the product PRO001 has been updated with the new MY PRODUCT TEST description. Quit NewWayService 4.

Within this tutorial, you learned how to import products into NewWayService 4. Also, this tutorial has demonstrated that by modifying information of the data source (the Excel file) and running again your import process, information were automatically updated. This principle is the same, no matter which data source used (in this case an Excel file, but could have been for example, the database of your accounting software). Don’t forget to erase the 5 test products added by this tutorial (you can do that from the Products option of NewWayService 4). The next tutorial shows you how to import a list of customers and how to manipulate data source using an Object Pascal script.

Page 41: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Tutorials

Data import/export utility for NewWayService 4

38

Tutorial 2 – Importing customers and writing script using Object Pascal language This tutorial shows you, step by step. how to import a list of customers to NewWayService 4 and how to manipulate data source, using an Object Pascal script. 1- Start the data import/export utility. 2- Select the Import data to NewWayService 4 option from the radio button then click the Start button. 3- Select Start a new data import option from the radio button then click the Next button. 4- From the Import data from group, select a file (Excel, Access, dBase, etc.), then click the … button at the right side of the filename edit box. From the dialog box, select the Excel files (*.xls) file type. Select the file tutorial.xls located in the installation folder usually C:\Progam Files\OroLogic\NewWayService4, then click the Open button. Click the Next button. 5- From the drop down list, select the Customers$ table, then click the Next button. 6- Leave the connection parameters already entered to connect to your default NewWayService 4 database or change these parameters to connect to another NewWayService 4 database. Then, click the Next button. 7- If the security is enabled into the selected NewWayService 4 database, enter a valid technician code and password (a technician code who has administrative rights), then click the Next button. Click directly the Next button if the security is not enabled. 8- From the Import to group, select Customers then click Next. 9- From the first drop down list, on the left side of the field * Customer code (String), select Field_CODE (String). From the second drop down list, on the left side the field * Customer name (String), select Field_NAME (String). From the third drop down list, on the left side of the field * Address (String), select >> Use Script << then click on the Script… button on the right side of the drop down list. Enter the following script into the edit box (Use Copy/Paste to prevent typing errors): begin ImportValue := Field_ADDRESS + #13#10 + Field_CITY + ' ' + Field_ZIP_CODE + ' ' + Field_STATE + #13#10 + Field_COUNTRY; end; Click the OK button to save the script. If an error is detected, it’s probably because the script was not entered correctly. From the fourth drop down list, on the left side of the field Phone 1 (String), select the Field_PHONE (String) field. From the seventh drop down list, on the left side of the field Contact (String), select >>Use Script <<. Click the Script… button on the right side of the drop down list, then enter the following script into the edit box (Use Copy/Paste to prevent typing errors): // This script has two utilities begin // Verify customer status. // Import only if customer is active. If Field_ACTIVE = 'NO' Then

Page 42: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Tutorials

Data import/export utility for NewWayService 4

39

SkipRecord := True; // Take only the first letter of the First Name then the Last Name ImportValue := Copy(Field_CONTACT_FIRSTNAME,1,1) + '. ' +Field_CONTACT_LASTNAME; end; Click the OK button to save the script and click the Next button. Notes about scripts used in this tutorial: The first script is used to format the address in a specific format. Since the Address field of the Customers module of NewWayService 4 is a unique field and can contain

several lines (memo field) and that in the Excel file, there are many fields for the customer address, a script must be used to format all fields of the Excel file to a unique field into NewWayService 4. You will also notice that the characters #13#10 are used to indicate to add carriage returns in the Address field to get address information on many lines. The second script has 2 utilities. The first part is used to indicate not to import records for which the ACTIVE field equal NO. The SkipRecord variable is used to do that. The second part is used to format the Contact

field. Only the first letter of the First Name is imported followed by the . character then, a space character then, the Last Name of the contact person. 10- As last parameters, check the option Save parameters of this import process for future use, then select the file name in which the parameters of this import process will be saved. Leave other

parameters as default, then click the Start import button. When the program asks you Are you sure you want to start the import process?, click Yes. 11- After the import process, you should have a summary of the import process, indicating that 4 records has been added. The Customers tab of the Excel file contains 5 customers but only 4 customers are active

(the ACTIVE field = YES). 12- Click the Close button, then quit the data import/export utility.

13- Run NewWayService 4, then verify that you have 4 new customers. Then, quit NewWayService 4. Within this tutorial, you learned how to import customers into NewWayService 4, using Object Pascal scripts. For more information about scripts, refer to the sections Use of scripts using the Object Pascal language and Object Pascal language reference. Don’t forget to erase the 4 test customers added by this tutorial (you can do that from the Customers option of NewWayService 4). The next tutorial shows you how to export a list of customers from NewWayService 4 to an MS Access database file.

Page 43: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Tutorials

Data import/export utility for NewWayService 4

40

Tutorial 3 – Exporting customers to an MS Access database file This tutoriel shows you, step by step, how to export a list of customers to an MS Access database file. 1- Start the data import/export utility. 2- Select the option Export data from NewWayService 4 from the radio button, then click the Start button. 3- Select Start a new data export option from the radio button, then click the Next button. 4- Leave the connection parameters already entered to connect to your default NewWayService 4 database or change these parameters to connect to another NewWayService 4 database. Then, click the Next button. 5- If the security is enabled into the selected NewWayService 4 database, enter a valid technician code and password (a technician code who has administrative rights), then click the Next button. Click directly the Next button if the security is not enabled. 6- Click the button Select a predefined query, select the query named Customers, then click the Open button. Click the Test query button, then click the Next button. 7- From the Export to group, select a file (Excel, Access, etc.), then click the … button on the right side of the filename edit box. From the dialog box, select the MS Access files (*.mdb) file type. Select the folder where you want the MS Access file to be created then, enter Test as file name. Click

Save. From the drop down list, select the MS Access file format you want to create. For example, if you are currently using the version 97 of Microsoft Access, select Access 97. Note that for example, if you select

Access 2000 but you currently use the version 97 of MS Access, the export process should work fine but

you will not be able to open the MS Access 2000 file from your MS Access 97 software. Click the Next button to continue to the next step. 8- From the drop down list, you should see NEW1. Replace this name by CUSTOMERS, then click Next. 9- At this step, since the destination table does not exist, a table with the same structure will be automatically generated and all query fields will be automatically assigned to the destination table. Simply click the Next button to continue to the next step. 10- As last parameters, select the Append to destination table but update existing records that match the key, then check the CUSCODDES field from the key fields list. Check the

option Save parameters of this export process for future use and select a file name in

which the parameters will be saved. Click the Start export button. Click Yes to the question Are you sure you want to start the export process?. 11- After the export process, you should have a summary of the export process indicating that records have been exported. Click the Close button, then quit the data import/export utility.

12- Open your MS Access file to verify that this file contains a file named CUSTOMERS and that the table contains the list of NewWayService 4 customers.

Page 44: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Tutorials

Data import/export utility for NewWayService 4

41

Within this tutorial, you learned how to export customers of NewWayService 4 to an MS Access database file. You will notice that if you update customers into NewWayService 4 and you run this export process again, the information in your MS Access database file will be automatically updated. If the MS Acces file does not exist, it will be automatically created. Within this tutorial, an MS Access file was used. However, for example, you could export information directly into your accounting software database. The next tutorial shows you how to export the list of spare parts used in your work orders to feed, for example, your inventory management software. Also, this tutorial includes an example about how using Object Pascal script when exporting data.

Page 45: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Tutorials

Data import/export utility for NewWayService 4

42

Tutorial 4 – Exporting spare parts and use of an Object Pascal script This tutorial shows you, step by step, how to export the list of spare parts used in your work orders to a dBase III file. Only spare parts in work orders updated in the last 15 days and having the Finished status (status 3 into the database) will be exported. 1- Start the data import/export utility. 2- Select the Export data from NewWayService 4 option from the radio button, then click the Start button. 3- Select the option Start a new data export from the radio button, then click the Next button. 4- Leave connection parameters already entered to connect to your default NewWayService 4 database or change these parameters to connect to another NewWayService 4 database. Then, click the Next button. 5- If the security is enabled into the selected NewWayService 4 database, enter a valid technician code and password (a technician code who has administrative rights), then click the Next button. Click directly the Next button if the security is not enabled. 6- Enter the following query (Use Copy/Paste to prevent errors), then click the Test query button to verify that the query is running fine. Then, click the Next button: SELECT WORACTPAR.WORCOD, WORACTPAR.WORACTCOD, WORACTPAR.WORACTPARCOD, WORACT.WORACTDAT, PAR.PARCODDES, WORACTPAR.WORACTPARDES, WORACTPAR.WORACTPARQTY, WORACTPAR.WORACTPARPRI FROM WORACTPAR, WORACT, WOR, PAR WHERE WORACTPAR.WORCOD = WORACT.WORCOD AND WORACTPAR.WORACTCOD = WORACT.WORACTCOD AND WORACT.WORCOD = WOR.WORCOD AND WORACTPAR.PARCOD = PAR.PARCOD AND WOR.WORMODDAT >= CURRENT_DATE – 15 AND WOR.WORSTA = 3; This query extracts the list of spare parts that has been used in work orders. Note the last 2 lines of the query which indicate to select only spare parts in work orders updated in the last 15 days and work orders which have the status equal to 3 (when installing NewWayService 4 the first time, the status 3 indicates that the work order is Terminated). Refer to the Data dictionary section to know the list of tables, fields and relations of NewWayService 4 available to use within query. Refer to the Firebird documentation for more information about SQL language versus Firebird. 7- From the Export to group, select a file (Excel, Access, etc.), then click the … button on the right side of the filename edit box. From the dialog box, select the dBase files (*.dbf) file type. Select the file tutorial.dbf located in the installation folder, usually C:\Progam Files\OroLogic\NewWayService4, then click Save. Finally, click the Next button. 8- From the drop down list, you should see TUTORIAL. Simply click the Next button. 9- At this step, from the first drop down list, on the left side of the field TRANS_NUM (String), select >>Use Script<<, then click the Script… button on the right side of the drop down list. Type the following script into the edit box (Use Copy/Paste to prevent errors): var TransNumber: String;

Page 46: Data import/export utility for NewWayService 4downloads.orologic.com/newwayservice/IMEX-Guide-lt.pdfTutorial 3 – Exporting customers to an MS Access database file_____ 40 Tutorial

Tutorials

Data import/export utility for NewWayService 4

43

begin TransNumber := Trim(IntToStr(Field_WORCOD)) + '-' + Trim(IntToStr(Field_WORACTCOD)) + '-' + Trim(Field_PARCODDES); ExportValue := TransNumber; end; Click the OK button to save the script. If an error is detected, it’s probably because the script was not entered correctly. Note about this script: This script is used to generate a unique transaction number. For example, if this export process is executed each night, even if same spare parts can be exported many times, there will not have double records for the same work order. By this way, if a record with transaction number already exists into the destination table, it will be updated. From the second drop down list, on the right side of the field TRANS_DATE (Date and Time), select Field_WORACTDAT. From the third drop down list, on the right side of the field PART_NUM (String), select Field_PARCODDES. From the fourth drop down list, on the right side of the field QUANTITY (Float), select Field_ WORACTPARQTY. From the fifth drop down list, on the right side of the field

PRICE (Float), select Field_ WORACTPARPRI. Click the Next button to continue to the last step. 10- As last parameters, select the option Append to destination table but update existing records that match the key, then check the field TRANS_NUM from the key fields list. Then, check

the option Save parameters of this export process for future use and select a file name in

which the parameters will be saved. Click the Start export button. Answer Yes to the question Are you sure you want to start the export process?. 12- After the export process, you should have a summary of the export process, indicating that records have been exported. Click the Close button, then quit the data import/export utility.

13- Open your dBase file (Note that MS Excel can open dBase file types) to verify that this file contains exported information. Within this tutorial, you learned how to export spare parts used in your work orders to a dBase file. Also, you learned how to use a script when exporting data. Within this tutorial, a dBase files was used. However, for example, you could export spare parts used in your work orders directly to your accounting software database.