0

I want to execute the following Statement:

select * from Matrix where Untersuchungsmethode='Fremdlabor'

The table Matrix exists also the field Untersuchungsmethode.

But I get the Error-message:

select * from Matrix where Untersuchungsmethode='Fremdlabor' [LNA][Zen][SQL Engine][Data Record Manager]The application encountered an I/O error(Btrieve Error 2)

What can be the reason?

Stu
  • 30,392
  • 6
  • 14
  • 33
Max Lindner
  • 171
  • 1
  • 1
  • 7

1 Answers1

0

An Error 2 indicates:
2: The application encountered an I/O error This status code typically indicates a corrupt file, an error while reading from or writing to the disk. One of the following has occurred:

  • The file is damaged, and you must recover it. See Advanced Operations Guide for more information on recovering files.
  • For pre-v6.0 data files, there is a large pre-image file inside a transaction, and there is not enough disk space for a write to the pre-image file.
  • For pre-v6.0 data files, there is one pre-image file for multiple data files. For example, if you name the data files customer.one and customer.two, both files have pre-image files named customer.pre.
  • For pre-v6.0 data files that are larger than 768 MB, there is a conflict among locking mechanisms. The file has not been corrupted. Your application can retry the operation until the conflict is resolved (when the competing application releases the lock your application requires).
  • A pre-v6.0 Btrieve engine attempted to open a v6.x or later MicroKernel file.
  • With Btrieve for Windows NT Server Edition v6.15.445, 32 bit Windows application may return Status 2 or “MKDE Terminated with Service Specific Error 0” after running an application for an extended period of time.

Since you didn't mention what version you are using, my first guess would be a corrupted file. You should rebuild the data file first.
The simplest way to rebuild the file would be to use BUTIL. Something like:

BUTIL -CLONE <newfile> <oldfile>

then

BUTIL -COPY <oldfile> <newfile>

You might lose a few records depending on the corruption. Once complete, rename the old file (or delete it) and then rename the new file to the old filename.

mirtheil
  • 8,952
  • 1
  • 30
  • 29