Hey everyone,
I am using the JET Provider to read dBase files in C#. I need to use dBase files due to a legacy system only supporting them.
I have been having a weird problem here at work with my testing. On my computer and my collegues computer the program works great with no hitches. However, on another collegues computer if they database name(dbf file name) is longer than 8 characters the program crashes with the following message:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Exception:
Error occured in :
Class: CSQLDatabase, in function: Select(ref DataSet dataSet).
Error:
Unable to execute select statement <SELECT DISTINCT Tag FROM Data_Log1_12_10_2007>.
The Microsoft Jet database engine could not find the object 'Data_Log1_12_10_2007'. Make sure the object exists and that you spell its name and the path name correctly.
at Utilities.CSQLDatabase.Select(DataSet& dataSet)
at EnergySmartReports.energySmartRptForm.executeButto n_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
CSQLDatabase is the name of my class for reading various databases in C#. This error only occurs on that one computer and I am stumped.
Anyone have any ideas on what could be going wrong?
If I limit the filename to 7 chars it works.
My only thought is to rename the filename to 7 chars length before processing to get around the error, but that seems like such a hack.
Thanks for the help,
Jon