Jump to content
Damon

External table not in the expected format

Recommended Posts

I have used both firedac and ado connections to connect to old paradox files to read the data and process to a mysql server.  I have gotten this working fin on my development machine.  When installing and running on a test machine i get the error:  external table is not in the expected format.

This happens with both connection types and I cannot figure out what is missing for different from the text machines.

Any suggestions?

Share this post


Link to post
Guest
1 hour ago, Damon said:

Any suggestions?

Your question was not very clear to me, so I ask:

  • On the target computer, is this where the Paradox tables are (also) installed (copied) or on this computer will you only use the MySQL Server Database?
  • If it is the first question above, do you have installed the BDEAdmin and BDE library so that Paradox files can be accessed, or are you using embedded ODBC drivers?
  • Is there any special configuration on the target computer that uses a different Code Page (Charset) than the development computer?
  • If possible more details about Paradox files, and for testing, you can upload a Paradox file (table) so that we can try to access it here?

hug

Share this post


Link to post

This is the program you were helping me with before.  I have the paradox tables on the target that are the same as the dev computer.  Charset is same.  I am using the MS standard odbc that comes with windows.  This works on my dev computer both with firedac and ado connections, but both fail on the target.  No BDE on target.

 

The odbc is configured on both computers the same.  MySQL is installed on both, but part works fine.  It is the paradox file connection that is the problem.  Sample data files here:  https://degei.com/D5/D4to5MigrationTool/Degei4.zip

Messagedlg('Load data process.  Starting data migration...',mtinformation,[mbok],0);
  adoconnection1.Connected := true;
  //START TABLE PROCESSING...
  showmessage('Connection is done. Start query.');
  countlabel.Caption := 'Working on ACTIVITY.DB table.';
  countlabel.Update;
  adoquery1.SQL.Text := 'select count(*) from activity.db';
  adoquery1.open;  //---------------------------OPEN QUERY FAILS WITH "external table not in expected format" error.  IT DOES THE SAME IF I USE FIREDAC CONNECTION.   The connections works, so the odbc config is working.
  adoquery1.Active := true;
  showmessage('query active with '+inttostr(adoquery1.fields[0].asinteger)+' records');
  progressbar1.Min := 1;
  if adoquery1.fields[0].asinteger > 0 then progressbar1.Max := adoquery1.fields[0].asinteger;

Share this post


Link to post
Guest

select count(*) from activity.db';

it would not be ...

select count(*) from activity

 

NOTE: "Activity.db" is a name from file on disk, but the SQL expression dont use it in its command. The Database look at folder (or in Database file) and SEE just table-name... not any "extension of files as on operating system do it". you see the difference?

 

it would be interessant that you zip your code used in access the database (string connection). 

 

i have posted a answer about ODBC and string connection here on forum, please search it in my profile - my post list.

 

try it

 

hug

Edited by Guest

Share this post


Link to post
Guest
4 hours ago, Damon said:

This is the program you were helping me with before.  I have the paradox tables on the target that are the same as the dev computer.  Charset is same.  I am using the MS standard odbc that comes with windows.  This works on my dev computer both with firedac and ado connections, but both fail on the target.  No BDE on target.

image.thumb.png.30f0d14f4e9fe4200d22845fe7754704.png

my FORM in TEXT-Format:

 

my FORM in TEXT:  FDConnection and FDQuery2 definitions

In your case, just inform the "SQL string", some like this:
"select * from biolife"  (in my case, "BIOLIFE.DB" in my folder with my Paradox files)
--------------------------------------------------------

  object FDConnection3: TFDConnection
    ConnectionName = 'myParadoxODBCconn'
    Params.Strings = (
      'ODBCDriver=Driver do Microsoft Paradox (*.db )'
      'User_Name=admin'
      'ODBCAdvanced=CollatingSequence=International;DefaultDir=D:\RioSa' +
      'mples\Data;DriverId=538;FILEDSN=D:\RioSamples\Data\MyParadoxODBC' +
      'driver.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;Parado' +
      'xNetPath=C:\Windows\system32;ParadoxNetStyle=4.x;ParadoxUserName' +
      '=admin;SafeTransactions=0;Threads=3;UserCommitSync=Yes'
      'DriverID=ODBC')
    LoginPrompt = False
    Left = 568
    Top = 429
  end

  object FDQuery2: TFDQuery
    Active = True
    Connection = FDConnection3
    SQL.Strings = (
      'select * from biolife')
    Left = 664
    Top = 424
  end

NOTE: 

  • The "big problem" using MSWindows is:
    • YOU CANNOT WRITE IN FILES ON "ROOT DIR SYSTEM C:\" --- you need change this, mainly, when using BDE system! (old software in new O.S. like MS Vista or better)
      • NET DIR should be, some like this:  "C:\YOUR-FOLDER-ROOT" (any name not used) or put in another disk, like:  D:\MYBDETEMP
        • this folder, should be (normally) PUBLIC FOR ALL USERS!!! Does not matter who it is!!!
      • PRIVDIR should be INTO YOUR APP FOLDER FOR AVOID CONFLIT WITH ANOTHER APPS USING BDE!!!
      • WORKDIR should be INTO YOUR APP FOLDER FOR AVOID CONFLIT WITH ANOTHER APPS USING BDE!!!
        • Why? Because, in a multi-user environment, you can have your files opened by another application BDE or similar, you see?
      • this configuration you can change on BDEAdmin (as ADMIN user)!!!
    • look above on "ODBCAdvanced" string: ....
      • ParadoxNetPath=C:\Windows\system32;.... --> another problem here!!!
        • in MSWindows, the SYSTEM32 folders deny any writes for common users (not ADMIN)
        • possible solution: change this part for another public folder or for you NETDIR folder

 

image.thumb.png.eeb3fc680d19ea3305f3af75a6d8cd3b.png

CollatingSequence=International;
DefaultDir=D:\Downloads\Degei4\Data;
DriverId=538;
FILEDSN=D:\RioSamples\Data\MyParadoxODBCdriver.dsn;
MaxBufferSize=2048;
MaxScanRows=8;
PageTimeout=5;
ParadoxNetPath=C:\EMB\BDENetDir;
ParadoxNetStyle=4.x;
ParadoxUserName=admin;
SafeTransactions=0;
Threads=3;
UserCommitSync=Yes

 

 

hug

Edited by Guest

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×