public void UpdateValue(dao.Field aField, string strValue) { dao.Recordset rs = Document; rs.Edit(); aField.Value = strValue; rs.Update((int)dao.UpdateTypeEnum.dbUpdateRegular, false); }
public override void SaveProperties(ExportObject export) { export.WriteProperty("Name", daoIndex.Name); export.WriteProperty("Primary", daoIndex.Primary); export.WriteProperty("Unique", daoIndex.Unique); export.WriteProperty("IgnoreNulls", daoIndex.IgnoreNulls); export.WriteProperty("Required", daoIndex.Required); export.WriteBegin("Fields"); dao.IndexFields idxFiels = (dao.IndexFields)daoIndex.Fields; for (int i = 0; i < idxFiels.Count; i++) { dao.Field fld = (dao.Field)idxFiels[i]; export.WriteBegin("Field"); export.WriteProperty("Name", fld.Name); export.WriteProperty("Attributes", fld.Attributes); //Descending order (dao.FieldAttributeEnum.dbDescending) export.WriteEnd(); } export.WriteEnd(); }
public override bool ProcessWordByWord(OfficeDocumentProcessor aWordProcessor) { Document.MoveFirst(); // to avoid an error on the first 'Edit' int nDontCare = 0; // don't care while (!Document.EOF) { dao.Fields aFields = Document.Fields; dao.Field aField = aFields[m_strFieldName]; if (aField.Value != System.DBNull.Value) { AccessRange aWordRange = new AccessRange(aField, this); try { if (!aWordProcessor.Process(aWordRange, ref nDontCare)) { return(false); } } catch (Exception) { throw; } finally { // this gets called whether we successfully process the word or not, // whether we're returning 'false' (in the try) or not, and whether we // have an exception or not... just exactly what we want, or MSAccess // process won't release when we exit. OfficeApp.ReleaseComObject(aField); OfficeApp.ReleaseComObject(aFields); } } Document.MoveNext(); } return(true); }
public DbFieldSelect(dao.TableDefs aTableDefs) { InitializeComponent(); for (int i = 0; i < aTableDefs.Count; i++) { dao.TableDef aTable = aTableDefs[i]; if (aTable.Attributes == 0) { TreeNode node = this.treeViewTablesFields.Nodes.Add(aTable.Name); dao.Fields aFields = aTable.Fields; for (int j = 0; j < aFields.Count; j++) { dao.Field aField = aFields[j]; node.Nodes.Add(aField.Name); OfficeApp.ReleaseComObject(aField); // needed or Access stays running after exit } OfficeApp.ReleaseComObject(aFields); } OfficeApp.ReleaseComObject(aTable); } }
public AccessRange(dao.Field basedOnRange, AccessDocument rsDoc) { m_doc = rsDoc; m_field = basedOnRange; }