简体   繁体   中英

The Microsoft Jet database engine could not find the object '…'

I have a folder containing a few paradox 5 files.

_folder = @"c:\\temp\\resource";

I then use the connection string

ConnectionString: Driver={Microsoft Paradox Driver (*.db )};DriverID=538;Fil=Paradox 5.X;DefaultDir=c:\\temp\\resource;Dbq=c:\\temp\\resource;CollatingSequence=ASCII;

Access the files.

    [Test]
    public void Paradoxgroupsales()
    {
        DataSet ds = new DataSet();
        ds = GetDataSetFromAdapter(ds, _connectionString, "SELECT * FROM groupsales");
        foreach (String s in ds.Tables[0].Rows)
        {
            Console.WriteLine(s);
        }
    }

public DataSet GetDataSetFromAdapter(DataSet dataSet, string connectionString, string queryString)
    {
        using (OdbcConnection connection = new OdbcConnection(connectionString))
        {
            OdbcDataAdapter adapter = new OdbcDataAdapter(queryString, connection);
            connection.Open();
            adapter.Fill(dataSet);
            connection.Close();
        }
        return dataSet;
    }

When I run the code I keep getting the following errors

System.Data.Odbc.OdbcException: ERROR [42S02] [Microsoft][ODBC Paradox Driver] The Microsoft Jet database engine could not find the object 'groupsales'. Make sure the object exists and that you spell its name and the path name correctly.

I know that the file exists and that it is reading from the right path because I have a paradox 4 file in the same folder and when I select from it the error is

External table is not in the expected format.

As I would expect.

Any help would be greatly appreciated

AI can understand from your post, there is no problem.

System.Data.Odbc.OdbcException: ERROR [42S02] [Microsoft][ODBC Paradox Driver] The Microsoft Jet database engine could not find the object 'groupsales'

means that there is no table 'groupsales'

Most likely the file name doesn't meet the MS-DOS 8.3 standards: http://support.microsoft.com/kb/209685

Make sure the file name of the table does not exceed 8 character for the name and 3 for the extension.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM