BDE Error at Run-time

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.
LVL 3
CyberSoftAsked:
Who is Participating?
 
kretzschmarCommented:
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
 
kretzschmarCommented:
Hi Cybersoft,

two suggestions

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

meikl
0
 
CyberSoftAuthor Commented:
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
 
CyberSoftAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.