Appearance
Flo_SaveDBDef
Declaration
C# public static extern bool Flo_SaveDBDef(ref string aXML, ref string aXML2);
Delphi function Flo_SaveDBDef(var aXML, aXML2 : PChar) : boolean; stdcall;
Example
csharp
try
{
TFloDBSource DBSource = new TFloDBSource();
DBSource.FIDS = "00000000-0000-0000-0000-000000000000";
DBSource.ModuleName = "My new module";
string XML = ObjectToXML(DBSource);
string XML2;
Boolean result = Flo_SaveDBDef(ref XML, ref XML2);
if (result)
{
MessageBox.Show("Successfully saved DB Definition - " + DBSource.ModuleName);
}
else MessageBox.Show("Error saving DB Definition");
}
catch (Exception ex)
{
MessageBox.Show("Exception saving DB Definition - " + ex.Message);
}pascal
Delphi
var XML, XML2: string
var oXML : DomDocument60;
try
oXML:= CoDOMDocument60.Create;
...create elements in XML as necessary...
XML := oXML.xml;
XML2 := '';
Result := Flo_SaveDBDef(XML, XML2);
if Result then
begin
showmessage('Successfully saved DB Definition - ' + VarToStr(oXML.DocumentElement.selectSingleNode('ModuleName').nodeValue))
end else
showmessage('Error saving DB Definition');
except
on e : exception do
showmessage('Exception saving DB Definition - ' + e.Message);
end;Description
This function saves the DB Definition specified by aXML and aXML2. If the FIDS element is set to an empty guid it will become a new module, otherwise set FIDS to the value of the module you wish to update. You can find the FID value by looking at the FID column in the FLO_DBSOURCES table of the configuration database
aXML contains the basic settings of the DB Definition as found on its front screen editor, aXML2 contains the design of the DB Definition.
If using C# you can easily work with the XML string by serializing an instance of a class to XML