Solved

BDE Error at Run-time

Posted on 1999-01-28
4
180 Views
Last Modified: 2012-05-04
Hi everyone

Got this really descriptive error once again in Delphi yesterday and was wondering if any of you have come accross this before or could explain WHY this error occurs and what it means.

Here's the error message :

Project MovieDB.exe raised exception class EDBEngineError with message 'Number is out of range. Table: E:\SourceCode\MovieDB\Main\bk00001.DB'. Process Stopped Use Step or Run to continue.

Now what my code does - that caused this error - is it creates a table in run-time as follows: (The error occurs on the CreateTable line)

FoundIt := FileSearch(tableFileName, CorrectedPath);
if FoundIt='' then
  begin
    with dataModule1.tblBookings do
      begin
        TableName:=CorrectedPath+tableFileName;
        tableType:=ttParadox;
        with FieldDefs do
          begin
            Clear;
            Add('Customer', ftString, 6, false);
            Add('Booked Date', ftString, 50, false);
          end;
        with IndexDefs do
          begin
            Clear;
            Add('', 'Booked Date', [ixPrimary, ixUnique]);
          end;
        try
          dataModule1.tblBookings.Active:=false;
          dataModule1.tblBookings.Exclusive:=true;
          CreateTable;
          dataModule1.tblBookings.Active:=true;
          Append;
          FieldValues['Customer'] := dataModule1.tblCustomers.FieldByName('Code').AsString;
          FieldValues['Booked Date'] := DateToStr(dateTimePicker1.Date);
          Post;
          dataModule1.tblBookings.Active:=false;
          dataModule1.tblBookings.Exclusive:=false;
        except
          MessageDlg('Error creating booking table '+tableName, mtWarning, [mbOK], 0);
          exit;
        end;
      end;
  end;

Suggestions, comments are more than welcome since the Help file isn't helpful at all in this regard - unless I'm missing something here.

Thanks in advance.
0
Comment
Question by:CyberSoft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1363740
Hi Cybersoft,

two suggestions

1. the primaryIndex should be the first field in the Table.
2. Maybe your CustomerString is to long.

meikl
0
 
LVL 3

Author Comment

by:CyberSoft
ID: 1363741
Meikl

Thank you once again my friend - you have saved me from a dilema. Silly me seeing that I did not change the order of creating the fields after I changed which field I wanted as the Primary Index.

Please post another comment as your answer and I'll give you the points.

Thanks once again!
Demitri
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 20 total points
ID: 1363742
Hi Demitri,

it seems your Project becomes a great dimension.
Good luck again, and i wish you a very happy end by your project.

meikl
0
 
LVL 3

Author Comment

by:CyberSoft
ID: 1363743
Thanks once again Meikl appreciate the comments. I'm noticing now more than ever that this (what seemed at first a simple task) has become more and more complicated. But thanks to your help (and others) I can continue to work on it and improve it!

Best of luck to you and your projects too!

Demitri

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question