Visual Fox Pro oledDB provider error "No value or one or more paramter required" in reading DBF ukranian files in execute reader()

Deepan Chakravarthy
1
Reputation point
Dear Team,
We are using VFPOLEDB data provider. We need to read the DBF file and convert this into CSV file. we are using VFPOLEDB.1 data provider to read the ukraninan file name ПолесьеПродукт_Товары.DBF. While executing line execute reader(), we are getting an error "No value or one or more paramter required". This is working fine when we have normal English character in the filename like ABC.dbf or TEST.DBF..etc. The problem lies only when we have non English character like Ukrainian letters in the file name then we are getting exception in execute reader() method.
dbfFilename = Path.GetFileName(FilePath);
string connvalue = @"Provider=VFPOLEDB.1;Data Source=" + InputFileInfo.DirectoryName + ";";
using (OleDbConnection oleDbConnectionStr = new OleDbConnection(connvalue))
{
oleDbConnectionStr.Open();
if (oleDbConnectionStr.State == ConnectionState.Open)
{
string mySql = "select * from [" + dbfFilename + "]";
OleDbCommand myQuery = new OleDbCommand(mySql, oleDbConnectionStr);
OleDbDataReader reader = myQuery.ExecuteReader();
DataTable dtSchema = reader.GetSchemaTable();
DataTable dtDbf = new DataTable();
List<DataColumn> listCols = new List<DataColumn>();
string columnName = string.Empty;
{count} votes
Hi TIm,
We are getting an error in Execute reader () line. Im using Visual FoxPro oledb dataprovider 9.0 version . Version would be the problem? The same code which we tried again and getting the same error.
@Deepan Chakravarthy
I think it may be unlikely to be related to the version.
If you are sure that this problem is only caused by the language of the file name, then the encoding problem mentioned by cheong00 may be the cause.
Hi Tim,
Can you please let me know which version of VFPOLEDB driver you installed in your PC. Have you done any language settings in your machine. Your same code I tried but same error.So if you provide me the version of VFPOLEDB then I will also download the same version and try .
Hi CHeong00,
Tried with the code page which you mentioned and getting same error. For time being I just renamed the filename before processing. But need to know the actual cause. ODBCconnection I changed but we need VFPODBC driver needs t o be installed right. So I did not try this one.
Thanks
Deepan.
Yup. I just checked and see Microsoft no longer release VFP OBDC driver since VFP6 (MDAC 2.5), so it's likely not suitable for your database files.
@Deepan Chakravarthy
I downloaded it from Microsoft's download center, and I haven't set the language, everything is the default English.
Sign in to comment
1 answer
Sort by: Most helpful
AFAIK, Foxpro does not support Unicode. So to open a file with Ukrainian filename, you need either of the following:
1) Set your non-Unicode language of Windows system to the code page the file is created (e.g.: 848/866/1123).
2) I remember ODBC v3+ requires Unicode support. So you may want to switch to ODBC connection instead and see if you can get a free ride of automatic conversion.
3) Rename the files in .NET to English before use OledbConnection to open it. Use a lookup list to keep track of what filename it originally was.
Sign in to comment