Databases

When working with NiceLabel you may have come across some unexpected troubles or error messages. Please check the FAQ sections below to see if your problem has already been solved.


How to use Oracle (MS SQL Server, DB2, Informix...) databases?

Oracle databases can be used in two different ways in NiceLabel. The first one is a connection via ODBC drivers for your Oracle server, the second one is a direct connection using BDE (Borland Database Engine). The latter one is faster and more reliable, but it requires the SQL Links component of BDE to be installed. SQL Links component is not installed by default, but is available as add-on on NiceLabel CD-ROM. You will find the full version of BDE in folder \Updates\BDE.

Solution: Please install the full version of BDE and then follow these steps:
  1. Start SETUP.EXE from \Updates\BDE\Setup\Disk1 folder on NiceLabel CD-ROM and follow on-screen instructions. This will install the full version of BDE including SQL Links (drivers for enterprise databases). Then run BDE511EN.EXE from \Updates\BDE folder to update the installed BDE to version 5.11.
  2. Go to Start.Programs.NiceLabel and start BDE Administrator.
  3. Select Databases tab and select Merge configuration from Object menu.
  4. Enter *.CNF in File name field and click Open.
  5. Select SQL_ORA8.CNF from the list and click Open.
  6. Select New from Object menu, select ORACLE for Database Driver Name, click OK.
  7. Enter the name of your new alias.<
  8. In definition of Oracle alias (right side of program window) fill the following fields:

    SERVER NAME (enter the name of your Oracle server/database),   NET PROTOCOL (probably TNS),   LANGDRIVER (set the appropriate language driver),
    USER NAME (enter the username you usually use to connect to server)

    Also verify the settings DLL32 and VENDOR INIT. They should match your version of Oracle server. Every version of Oracle should be used with its own version of .DLL file.

  9. Close the BDE Administrator and save the changes.
  10. Now let's verify that alias can connect to the server. Re-open BDE Administrator and select the Oracle alias, you have created in previous steps, right-click it and select Open. Enter the password. If everything is OK, the alias settings should appear in bold font.
  11. Close the BDE Administrator and use created alias in NiceLabel. Use command Database access from Data menu, then select New.

The same procedure can be applied to other kinds of enterprise databases as well. Just make sure to select the .CNF file that describes your type of the database and then define the alias accordingly. Applies to: all versions, all editions
Last revision: December 2001


Locking Paradox databases in multi-user network environment.

Locking of database files in network environment is important for their consistency. If two or more users would be able to simultaneously write to the same database table, they could not be aware of updates to the table some other user has made. Only the changes from the last user who saved the label are preserved and all previous are ignored.

As a solution to these problems Paradox introduces special locking mechanism that has its use in network environments. It is network control file, PDOXUSRS.NET. The net file contains the users currently using the BDE (Borland Database Engine) and which table they're accessing. This is how NiceLabel knows which tables are in use by other users and will not allow you to alter them simultaneously. It also serves as the reference point for all lock files created by Paradox. Each lock file references the network control file and contains information regarding the locks on the table and by which user. It is vital that each user maps to the same network control file.

How to map to the network control file?

  1. Go to Start.Programs.NiceLabel and start BDE Administrator.
  2. Select Configuration tab.
  3. Select Drivers, then Native and lastly Paradox.
  4. Select NET DIR and browse the directory, where PDOXUSRS.NET resides for your network.

Please note! Every user in your network should set NET DIR to the same directory.

If a network file server stores databases, this set-up will be enough. But if databases are stored on some workstation computer, that shares them to other computers but accesses them as well, one further modification in BDE Administrator will have to be made.

  1. Start BDE Administrator one more time.
  2. Select Configuration tab.
  3. Select System, then INIT.
  4. Select LOCAL SHARE parameter and change it to TRUE.

Applies to: all versions, all editions
Last revision: December 2001


Using local language characters with dBase databases.

When printing labels with data from dBase databases it can happen that some of your local language characters are not printed correctly. The cause for this behaviour is misconfiguration in language settings of the BDE (Borland Database Engine).

Solution:

  1. Start the program BDE Administrator, it can be found on you Start menu (Start.Programs.NiceLabel.BDE Administrator).
  2. Open Database tab and open setting for dBase Files. Select appropriate language driver for LANGDRIVER (i.e. "dBASE SLO cp852" for local slovenian characters).
  3. Open Configuration tab and open dBase settings in Local.Native. Select appropriate language driver for LANGDRIVER (i.e. "dBASE SLO cp852" for local slovenian characters).
  4. Close BDE Administrator and save changes.

Applies to: all versions, all editions
Last revision: December 2001


Values from Excel worksheet do not appear in NiceLabel. The database-variables are empty or not formatted properly.

When you have connected an Excel worksheet to the label, sometimes the data from worksheet is not transferred to the variables on the label and they remain empty. Or the data formatting from Excel spreadsheet is not transferred to label variables correctly. This can happen when column in worksheet contains mixed data: some fields are alphanumerical and other numerical.

Microsoft ODBC driver tries to auto-detect the type of data entered in the cells, but sometimes this auto-detection routine fails and data type is wrongly recognized.

Solution 1: Reformat the cell types in the spreadsheet to Text format. This approach might not provide the required result. Do the following:

  1. Make sure that all values in the same column are of the same type.
  2. If that is not possible and you need to use mixed data, format the column as Text and not Generic (on the Format menu, click Cells, and select the Text option on the Numbers tab).
  3. The column formatting has to be performed prior the actual data entry.
  4. If the data is already entered, you will have to re-format the values using function TEXT (refer to MS Excel help for proper syntax of this function).

Solution 2: In this case you will export the data from your Excel spreadsheet into the text file with tab-separated values. You will then import the data into new spreadsheet paying attention to the data type for fields (all fields will be formatted as Text). Do the following:

  1. Open your Excel spreadsheet.
  2. Select the command Save As in the File menu.
  3. For the file type select Text (Tab delimited) (*.txt).
  4. Save the values.
  5. Close the spreadsheet in Excel.
  6. Open the Tab delimited text file you have just created.
  7. Follow on-screen instructions for how to import the data from the text file.
  8. Make sure you format the fields as Text.
  9. Select the command Save As in the File menu.
  10. Save the spreadsheet to Microsoft Excel Workbook (*.xls) format.
  11. Use this Excel workbook as data source for label printing.

More information about this issue can be found in the Microsoft Knowledge Base, article No. Q141284

Applies to: all versions, all editions
Last revision: December 2002


When I use Excel database in NiceForm the "Database login" dialog box is shown at form start-up and data from Excel do not show.

The problem originates in the fact is that two different applications cannot access Excel spreadsheet at the same given time. MS Excel itself can handle multiple connection to the same .XLS and if you open the .XLS file in one instance of MS Excel, it will be opened in read/write mode. If then some other user opens the same file in his instance of MS Excel, he will be prompted that only read-only mode is available to access the file.

But if you connect to MS Excel spreadsheet from some other application, the first user will be allowed to connect to it and will lock the file. So the second user is not allows the connection to the spreadsheet and will see the "Database login" dialog box.

There are two workarounds you can try:

Workaround 1: Disable Data view in NiceLabel Pro software and enable Normal view. This can be performed in View menu. Data view is used to preview the data values for the current record on the label. In order to to that NiceLabel Pro has to connect to MS Excel spreadsheet and thus locks the file. If NiceLabel Pro does not preview the data on the label, NiceForm will be able to connect to the same Excel spreadsheet.

Workaround 2: Do not make connection to the database on the label at all. Instead create prompted variables on the label. Connect to the database only in NiceForm. Then make sure to map the database fields and label variables together in order for databsae values to be transferred to the variables.
In this case NiceForm is the only application connecting to the Excel spreadsheet and "Database login" dialog box will not be shown.

Applies to: all versions, all editions
Last revision: December 2002


I cannot use data from FoxPro database tables.

Databases created in FoxPro (with file extension .DBF) are not natively supported in NiceLabel software. There is no database driver provided for connection to such data in NiceLabel installation. If you need to link to FoxPro databases there are two solutions available for you. Use one of the following solutions.

Solution 1 (recommended): To connect to FoxPro databases and obtain the data out of them the appropriate ODBC driver must be installed on the system. You must create the Data Source Name (DSN) in ODBC Data Source Administrator. This utility is located inside Administrative Tools in Control Panel. Then use this DNS as the ODBC source in NiceLabel software.

Solution 2: If you do not have the ODBC driver for FoxPro installed on the system, you can use a different approach. You can convert the FoxPro database to some other database format for which the driver is available. It can be done like this.

  1. Start Microsoft Excel application. Open the FoxPro database. Just use the Open command in the File menu. The data from FoxPro table will be displayed in the spreadsheet.
  2. Select the command Save As from the File menu and save the database in the .dbf (dBase) file format.
  3. Start NiceLabel software and use the database wizard to link to the converted database. The driver for dBase table access are installed with NiceLabel software.

Applies to: all versions, al editions
Last revision: August 30, 2004


I cannot use data from dBase database tables in NiceForm.

You have created the form in NiceForm application and have linked it to the dBase database. You can see the dBase table in the design NiceForm window. But as soon as you start your form, the run NiceForm window does not show the data in the table object. When you open the properties of the table object, you can experience the error message 'Access violation'.

Based on the information and research that was conducted the problem seems to occur in the development environment used to program NiceForm (Borland Delphi). NiceForm uses different connection technologies like ADO (ActiveX Data Objects) and BDE (Borland Database Engine) to be able to connect to the widest array of database types. When different database connectivity technologies are used at the same time and Windows XP SP2 is installed on the system, the application cannot connect to the dBase tables. Several Delphi-developed applications created by other developers have the same problem, so not just NiceForm is affected.

At this moment NiceForm V4 does not support the dBase tables. The same feature is working in NiceForm V3. The following workarounds are suggested:

Workaround 1 (recommended): Convert your dBase database to some other database type, like Access or Paradox. You can use the application NiceData to convert the database type.

Workaround 2: Remove the Windows XP Service Pack 2 from the computer.

Applies to: versions 4.X, NiceLabel Suite
Last revision: August 31, 2005


How can I convert text file to a real database?

Text files are often used as files with data for the labels. Text databse are usually generated from some software that does not have the label-printing features. NiceLabel can use the text file and print the data on the label, thus adding label-printing capability.

The text file is not a real database. This brings two major limitations:

  1. The text file doesn't have stored the definition of the fields.
    The applications can be aware of the field name (if it is stored in the first line in the text file), but not aware of the structure of the text file. The information about fields types (numeric, alphanumeric, etc.) and field lengths is not known and you have to set it manually.
  2. You cannot define indexes in the text file.
    Because of this fact the database connectivity options in NiceLabel software are limited. For example, you cannot change the printing order, or you cannot define a filter on some field.

Luckily, there is an easy way in NiceLabel software to convert the text file into the real database. The idea is the following: Use NiceData to define the structure of the text file, then use NiceData to save text file into a real database. Follow these steps:

  1. Start NiceData.
  2. Open the text file.
    The structure of the text file is not known so Text File Wizard opens.
  3. Follow on-screen instructions and define the structure of your text file.
    You can store the name of the fields in the first line of the text file.

    When you define the structure of the text file, the definition will be save in the file with extension .SCH in the same folder, where the text database is stored. When you open the text file some other time, the structure will be read from the definition .SCH file.
  4. Create a new empty database in NiceData. Make sure the database has the same structure of fields as the fields in your text file.
  5. Close the new database in NiceData. Leave the text file opened.
  6. Select the command Fill from the Tools menu.
  7. The text file is selected for the 'Source Table'. Select your empty database for the 'Destination Table' field.
  8. Click on the Map Fields button.
  9. Link the appropriate fields from the text file and from the database. If the fields have the same names, NiceData will link the automatically.
  10. Click OK to return to the Fill Table dialog box.
  11. Click OK to begin with the filling of the table.

Please note, the same procedure can be applied automatically. You can use NiceData command-line switches and control the conversion process from some other information. For example, you can define a form in NiceForm where a click on a button will convert text file into real database. Refer to the NiceData help file.

Applies to: all versions, NiceLabel Pro and NiceLabel Suite
Last revision: September 5, 2005

If you have any additional questions, suggestions, bug report or need more information please contact the technical support at tvqqpsuAojdfmbcfm/dpn