I need to write a utility to extract data from an Excel file and write it into a DBF (CDX) with memo fields. One text cell needs to be translated into MS-Word .doc format and stored as a byte array in a memo field.
I have a converter that gives me a byte[] with the required .doc format, but when I try to write the array into the memo field I get this error on the FieldPutBytes line.
Code: Select all
XSharp.Core.Functions.SetAnsi(false);
XSharp.Core.Functions.SetExclusive(false);
XSharp.Core.Functions.SetDateFormat("MM/DD/YY");
XSharp.Core.Functions.SetEpoch(1990);
XSharp.Core.Functions.SetDeleted(true);
QW10DocumentConverter converter = new QW10DocumentConverter();
DbServer mwriter = new DbServer(@"D:LiveQWPartsM.DBF", false, false, "DBFCDX");
if (mwriter.Used)
{
foreach (VMQW10PartsMItem item in itemlist)
{
mwriter.Append();
byte[] bytespec = converter.ConvertStringTextToWordDoc(item.Spec);
mwriter.FieldPutBytes("SDESCR", bytespec);
}
mwriter.Commit();
mwriter.Close();
}
I'm sure it's a silly error by me, but can someone give me a hint as to what's wrong.
TIA
Nick