467,907 Members | 1,457 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,907 developers. It's quick & easy.

Failed query blob columns from Paradox databse via ODBC

Attached please find my code. I failed to query the blob column. Note the Paradox driver version is 4.0. The error is:

Error code: -2146232009
Error msg: ERROR [07002] [Microsoft][ODBC Paradox Driver] Too few parameters. Expected 1.
Source: odbcjt32.dll


I can query non-blob columns of the table with the same code. Can you please tell me what the problem is? Is this the limitation of .Net Framework Data Provider for ODBC? Do I need to use SQLOLEDB instead? Will SQLOLEDB resolve the issue?

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

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.


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.


Expand|Select|Wrap|Line Numbers
  1.             DataSet dsUsers = new DataSet();
  2.             string strQuery = "SELECT blobColumn FROM users";
  3.             dsUsers = GetNames(strQuery, "Driver={Microsoft Paradox Driver (*.db )}; Default Dir=<directory>;DBQ=<directory>");


Expand|Select|Wrap|Line Numbers
  1.         private DataSet GetNames(String strQuery, String strConnect)
  2.         {
  3.             DataSet dsNames = new DataSet();
  4.             try
  5.             {
  6.                 OdbcConnection conOdbc = new OdbcConnection(strConnect);
  7.                 OdbcCommand cmdOdbc = new OdbcCommand(strQuery, conOdbc);
  8.                 OdbcDataAdapter odaOdbc = new OdbcDataAdapter(cmdOdbc);
  9.                 odaOdbc.Fill(dsNames);
  10.                 conOdbc.Open();
  11.                 conOdbc.Close();
  12.             }
  13.             catch (OdbcException eExc)
  14.             {
  15.             }
  16.             catch (Exception eExc)
  17.             {
  18.             }
  19.             return dsNames;
  20.         }
Oct 15 '10 #1
  • viewed: 2623
Share:
1 Reply
I also tried using Microsoft OLE DB provider. There was also an error:
"No value given for one or more required parameters."

I think there mst be a way to import blob columns from Paradox database in C#. Any ideas?
Oct 15 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Peter Arrenbrecht | last post: by
2 posts views Thread by Puneet Murgai | last post: by
2 posts views Thread by Michael Gerbasio | last post: by
3 posts views Thread by Chris | last post: by
3 posts views Thread by Danny.McCarthy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.