Language Drivers Errror?? Please Help ASAP

When system boots up client gets
"Language Drivers of table and index do not match"
It is a dBase IV table.
How do i fix this?
LVL 1
bozo7Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
kretzschmarConnect With a Mentor Commented:
hi bozo,

glad that this helps you,
>you work at alot and read alot.
yup, and i try a lot (with sometimes horrible results ;-))
all this is a must in this part of buesiness
to be uptodate (and that is not so easy)

good luck again

meikl ;-)
0
 
kretzschmarCommented:
hi bozo7,

two possibilities

1.drop the indexes and recreate again
2.select the language driver for the alias, with which the table(s) are created

try and let me know

meikl ;-)
0
 
kretzschmarCommented:
appendix,

to 1.
maybe you must delete the indexes via filesystem and not with the table-component

meikl
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
kretzschmarCommented:
hi bozo7,

if your index an .mdx (masterindex),
then you can do something like this

procedure TForm1.Button1Click(Sender: TObject);
var mystream : TFileStream;
    PB : Byte;
    SL : TStringList;
    s : String;
    oldIdxFNames : String;
begin
  table1.Close;
  oldIdxFNames := table1.IndexFieldNames; //prevent a EDatabaseError
  table1.IndexFieldNames := '';
  try
    Table1.Exclusive := True;
    Table1.Open;
  except
    On E : EDBEngineError do
    begin
      if (e.Errors[0].ErrorCode = 9997) or     //If Error Index not available
         (e.Errors[0].ErrorCode = 10049) then  //Language Driver Error
      begin
        try
          SL := TStringList.Create;    // Retrieve Path, only if an Alias is used
          session.GetAliasParams(Table1.DataBaseName,SL);
          s := SL.Values['PATH'];
          SL.Free;                    // End Retrieve Path
          if s[Length(s)] <> '\' then s := s+'\';
          if (e.Errors[0].ErrorCode = 10049) then  //delete mdx-index-file
          begin
            If FileExists(s+ChangeFileExt(Table1.TableName,'.MDX')) then
              if deletefile(s+ChangeFileExt(Table1.TableName,'.MDX')) then
              else
              begin
                Showmessage('Could not Delete '+ChangeFileExt(Table1.TableName,'.MDX'));
                exit;  //Leave Procedure
              end;
          end;
          MyStream := TFileStream.Create(S+Table1.TableName,
                                         fmOpenReadWrite or fmShareExclusive);
          MyStream.Position := 28;  // Patch KeyFlag
          PB := 0;
          MyStream.write(PB,1);
          MyStream.Free;
          try
            Table1.Open;  // Retry to Open
          except
            Showmessage('Could not open '+Table1.TableName);
            exit;  //Leave Procedure
          end;
        except
          Showmessage('Problem with File : '+s);
          exit;  //Leave Procedure
        end;
      end
      else
      begin
        Showmessage(e.Errors[0].Message);  //A other DBEngineError
        exit; //Leave Procedure
      end;
    end;
    On e : EDatabaseError do
    begin
      Showmessage(e.Message);  //A DatabaseError
      exit;  //Leave Procedure
    end
    else
    begin
      Showmessage('There was an error');  //A other Error
      exit;  //Leave Procedure
    end;
  end;
  Try  //it will guessed here that it is the first field
    table1.AddIndex(copy(Table1.Name,1,Length(Table1.Name)-4),Table1.Fields[0].FieldName,[ixUnique]);
    table1.IndexFieldNames := oldIdxFNames;
  except
    Showmessage('Cannot create Index');
  end;
end;

meikl
0
 
bozo7Author Commented:
I can't even open the table with Database Desktop. Well i can open it but i get an error message and then it is read only.
I suppose i could recreate the table. That would not be to bad.
0
 
kretzschmarCommented:
hi bozo,

try my code ;-)
if not work at first step,
then delete the .mdx file before by hand

meikl
0
 
bozo7Author Commented:
meikl,
Thank you so very much. I was looking forward to a day of banging my head against my monitor. Post an answer and you can have the points along with huge thanks.
How do you know all of this stuff? I suppose you work at alot and read alot.
0
All Courses

From novice to tech pro — start learning today.