More Group Sites
School Rankings
Jobless Net
Better Home
Enviro++


Help | Subscribe/Unsubscribe | Rules | Other Group Sites: Better Education | Better Education Forum
Welcome Guest Search | Active Topics | Members | Log In | Register

ERROR [07002] [Microsoft][ODBC Paradox Driver] Too few parameters. Expected 1 Options · View
hong
Posted: Thursday, October 14, 2010 8:50:03 PM

Rank: Administration
Groups: Administration

Joined: 11/23/2008
Posts: 335
Points: 711
Location: Australia
What does the following error message mean?
Error code: -2146232009
Error msg: ERROR [07002] [Microsoft][ODBC Paradox Driver] Too few parameters. Expected 1.
Source: odbcjt32.dll


The best way to deal with the issue is to copy the query string and run it in Borland SQL Explorer. It will point to the place where the error occurred.

Here are my findings:
1. Have you placed fields in []? If so, remove the brackets.

2. Have you selected a BLOB field in your select statement? An sql query with BLOB fields works fine in Borland SQL Explorer but it triggers this exception via Microsoft ODBC Paradox Driver. As stated in http://msdn.microsoft.com/en-us/library/aa215269%28SQL.80%29.aspx,
Code:
When using the Microsoft OLE DB provider for ODBC with the SQL Server ODBC driver, all BLOB columns should be arranged after columns with other data types in a source rowset. You can use a SELECT statement to rearrange the BLOB columns to the end of the source rowset. The DTS Import/Export Wizard performs this operation automatically.
Sponsor
Posted: Thursday, October 14, 2010 8:50:03 PM
hong
Posted: Friday, October 15, 2010 3:53:34 PM

Rank: Administration
Groups: Administration

Joined: 11/23/2008
Posts: 335
Points: 711
Location: Australia
How to query blob columns from Paradox database in c#?

I need to read blob columns from Paradox database using c#.

First, I tried using .Net Framework Data Provider for odbc. Here is my code:
Code:
            DataSet dsUsers = new DataSet();
            string strQuery = "SELECT blobColumn FROM users";
            dsUsers = GetNames(strQuery, "Driver={Microsoft Paradox Driver (*.db )}; Default Dir=<directory>;DBQ=<directory>");


Code:
        private DataSet GetNames(String strQuery, String strConnect)
        {
            DataSet dsNames = new DataSet();
            try
            {
                OdbcConnection conOdbc = new OdbcConnection(strConnect);
                OdbcCommand cmdOdbc = new OdbcCommand(strQuery, conOdbc);
                OdbcDataAdapter odaOdbc = new OdbcDataAdapter(cmdOdbc);
                odaOdbc.Fill(dsNames);
                conOdbc.Open();
                conOdbc.Close();
            }
            catch (OdbcException eExc)
            {
            }
            catch (Exception eExc)
            {
            }
            return dsNames;
        }


Note the Paradox driver version is 4.0.

I failed to query the blob column even just the single blob column. I tried placing the blob column after the other non-blob columns, I still got the same error. However I can query non-blob columns of the table with the same code.

I also tried Microsoft OLE DB provider using the following code. There was also an error:
"No value given for one or more required parameters."

Code:
            System.Data.OleDb.OleDbConnection ParConn;
            DataTable schemaTable;
            ParConn = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\db;"+
                 "Extended Properties=Paradox 4.x; Persist Security Info=False");
            System.Data.OleDb.OleDbCommand myCmd = new System.Data.OleDb.OleDbCommand();
            System.Data.OleDb.OleDbDataReader myReader;
            myCmd.CommandType = CommandType.Text;
            myCmd.Connection = ParConn;
            myCmd.CommandText = "SELECT blobColumn FROM users";
            ParConn.Open();
            myReader = myCmd.ExecuteReader(CommandBehavior.SequentialAccess);
            schemaTable = myReader.GetSchemaTable();
            ParConn.Close();



I noticed the following statement at http://msdn.microsoft.com/en-us/library/aa215269%28SQL.80%29.aspx:

Quote:
When using the Microsoft OLE DB provider for ODBC with the SQL Server ODBC driver, all BLOB columns should be arranged after columns with other data types in a source rowset. You can use a SELECT statement to rearrange the BLOB columns to the end of the source rowset. The DTS Import/Export Wizard performs this operation automatically.


Can you please tell me what the problem is? Is this the limitation of .Net Framework Data Provider for ODBC or Microsoft OLE DB provider for ODBC?

Again I tried placing the blob column after the other non-blob columns, I still got the same error.

I also tried "Import and Export Data" Wizard shipped with SQL Server Management studio. I couldn't import the table with blob columns.

Brick wall

Your help would very much appreciated.
hong
Posted: Tuesday, November 02, 2010 7:53:27 AM

Rank: Administration
Groups: Administration

Joined: 11/23/2008
Posts: 335
Points: 711
Location: Australia
I posted this issue to a couple of online forums. I got only one reply with a suggestion.
Quote:
You need a real Paradox driver. The Microsoft one does not support reading blobs:

http://support.microsoft.com/kb/300189
Although DAO does not recognize or work with Paradox BINARY BLOB fields, DAO does recognize and work with Paradox OLE BLOB fields.


Following some more research, I can conclude the following:
.Net Framework Data Provider for ODBC or Microsoft OLE DB provider for ODBC does not support Paradox 4.x Blob data type

I submitted a bug report to Microsoft: https://connect.microsoft.com/VisualStudio/feedback/details/614786/net-framework-data-provider-for-odbc-does-not-support-paradox-4-x-blob-data-type

I don't think Microsoft will address this defect for a good reason - Paradox is dead, because BDE is dead.

In this instance, you might need to use the old native Paradox drivers:
Quote:
Versions of Paradox for Win 95 / Win NT and Service packs
http://hem.bredband.net/bertilisberg/paradox/versions.htm
Information below on Paradox7 relates to the standalone version of Paradox released by Borland. It does not apply to the version of Paradox 7 released as part of the WordPerfect 7 Suite

Since Paradox 9.0 SP4, there is no stand alone Paradox. It's only available as part of the WordPerfect Office Suite.


You don't need an ODBC Paradox driver if you use a BDE client application in Delphi. But if you want to import a paradox database into a SQL Server database , you need an ODBC in the server.

ODBC drivers for Paradox database are not native Corel ones. several companies make ODBC drivers, for example, DataDirect.

Do I have to install the BDE to allow access to the Paradox data via ODBC?
Yes, you will need to install BDE to use ODBC Paradox drivers except the following non-BDE Paradox drivers (Jet database engine only).

Quote:
http://support.microsoft.com/kb/263561
INFO: Non-BDE Paradox and dBase ISAM Drivers
Microsoft has created new Paradox and dBASE ISAM drivers for Microsoft Jet 4.0 that do not require the installation of the Borland Database Engine (BDE) to provide full read/write access to Paradox and dBASE files. The current Jet 4.0-based Paradox and dBase ISAM drivers that ship with Microsoft Data Access Component (MDAC) 2.1 and later, allow read-only access to Paradox and dBASE files unless the BDE is installed. The Jet 3.51 version of these ISAM drivers provides this functionality without the use of the BDE.


I also tried the latest ODBC Driver Pack from DataDirect Technologies, a third party company that specializes in writing ODBC drivers. The ODBC Driver Pack is a set of industry standard ODBC drivers. Unfortunately the ODBC Paradox driver has been removed from the pack "Pogress DataDirect Connect for ODBC". I contacted the company for the Paradox driver support. According to its tech support, they could make the driver available.
http://www.synametrics.com/SynametricsWebApp/OdbcDrivers.jsp

At the end, I decided to write an Delphi app, which converts the blob columns to a couple of columns with supported data types, in native Delphi/BDE environment. My .NET application starts the Delphi app to do the conversion first and then import both the original and converted Paradox data into SQL Server database using ODBC Paradox drivers.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

ASPNET Theme created by Boskone (Dan Ferguson)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.261 seconds.