Solved

BDE Error at Run-time

Posted on 1999-01-28
4
175 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now