tags:

views:

230

answers:

1

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

+1  A: 

A I 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'

ironic
to be more exact: no table, stored procedure, view or any other object from which you can select
ironic