none
Paradox 5.x "External table is not in the expected format." RRS feed

  • Question

  • I've got a very simple command-line application (C#, .NET 3.5, running on Windows Server 2003) that accesses a Paradox 5.x table.

    When I run the program from a command prompt, it works great.

    When I launch the program as a scheduled task running as my logged on account, it works great.

    When I launch the program as a scheduled task running as another account (admin access, even), it fails with the message "External table is not in the expected format."

    I've tried everything I can think of.  ODBC, OleDb, even reading it via Linked Table in an MDB, etc.  The same result every time.  Works fine if I use my current account but fails when I log off or run it as a user who is not currently logged on.

    A few other notes that might be important: BDE is installed on the computer.  I am only reading data from the table - never writing.  There are no ancillary files (PX's, etc.) for the table.

    I need to be able to run this as a service or scheduled task and it's not practical to leave a user logged on with an unlocked screen for the rest of time.  I've searched and found a million hits on the error message - seems like it could mean just about anything.

    Can anyone help with this?  I am desperate!

    Thanks.
    -C
    Friday, August 21, 2009 7:16 PM

All replies

  • Hi C,

    Could you explain what is your logged account and the other account?
    Do you mean the account is used for connection string?

    If you provide some code blocks, we'll have better understanding of your problem.

    Best Regards

    Yichun Feng

    Thursday, August 27, 2009 4:31 AM
  • Could be that the service account does not have sufficient permissions to the folder where the file is located.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Thursday, August 27, 2009 2:19 PM
  • Could be that the service account does not have sufficient permissions to the folder where the file is located.
    Paul ~~~~ Microsoft MVP (Visual Basic)

    It can be the same account I log on as.  But when I'm logged on, it works, if I log off and the scheduled task runs as my account, it fails.  So it doesn't appear to be a file permission issue.  Is there some other type of permission that might be required for the my account to be used this way (besides run as service which is also granted)?
    Thursday, August 27, 2009 5:30 PM
  • Hi C,

    Could you explain what is your logged account and the other account?
    Do you mean the account is used for connection string?

    If you provide some code blocks, we'll have better understanding of your problem.

    Best Regards

    Yichun Feng


    Sure - Here's a bit of simplified code:

    //-----
    using (var cn = new OleDbConnection { ConnectionString = "Driver={Microsoft Paradox Driver (*.db )};DriverID=538;Fil=Paradox 5.X;DefaultDir=C:\Data\;Dbq=C:\Data\;CollatingSequence=ASCII;" })
    {
        cn.Open();
        var cmd = new OleDbCommand("SELECT * FROM MyTable", cn);
        var dr = cmd.ExecuteReader();
        while (dr.Read())
        {
            // ...
        }
    }
    //-----

    If I stick that in a console line app and run it from the command line, it would read the table.  If I create a scheduled task to run that program and set the service account to my own credentials, It will run (and a command window will pop up while it's executing).  If I use that same task and schedule it to run but log off for a bit (while it's set to run), I log back on and the logging I have around the sample code writes a message to my log file from the exception that occurred - "External table is not in the expected format."

    Thanks.
    -C
    Thursday, August 27, 2009 6:09 PM
  • Have you tried checking the Windows Event Log to see if there are any corresponding errors. I've seen this error before with Paradox databases but usually it doesn't work under any circumstance.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Thursday, August 27, 2009 8:08 PM
  • Have you tried checking the Windows Event Log to see if there are any corresponding errors. I've seen this error before with Paradox databases but usually it doesn't work under any circumstance.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Thanks for the reply.

    I've monitored the Event Log and the only message I get during these failures is the exception that I caught and logged.  No other messages.

    The information I've found online related to this error is all over the board.  I think it's sort of a catch-all message.  Some people find that it's related to the character set and for some, it's file permissions, etc.

    -C
    Thursday, August 27, 2009 8:37 PM
  • Does this database have any memo type columns? Have you tried using the Jet OLEDB Provider/Paradox ISAM w/o installing the BDE?
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Thursday, August 27, 2009 8:46 PM
  • There are no memo columns in this table.  I've tried using the Jet OLEDB Provider and got the same error, but BDE was still installed.  I don't have the option of uninstalling BDE from the server - it's required by another application.  Is there a way for me to force the driver to skip the BDE?  Since I'm only reading data (never writing), I should never need it, right?
    Thursday, August 27, 2009 8:49 PM
  • I'm not aware of any way to tell Jet to ignore the BDE. In any event, I was just curious to see if the behavior wasn't any different w/o the BDE (e.g. no error).

    Without the BDE, the Paradox ISAM driver will place exclusive locks on the database so multi-user access is not available.

    I'm not sure which version of Windows you are using but is Jet version 4.0 SP5 or later installed?
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Monday, August 31, 2009 2:53 PM