on 02-07-2006 10:19 AM
I'm developing my own tool (using c#.net) in order to export User Tables, UDO and reports from a company to another. Now I would like to add a new option into my tool which allows the user to export the company's objects into xml files.
I just tried using something like the following:
myUserTable.SaveXml(ref thePath);
but the created file contains just the following:
<?xml version="1.0" encoding="UTF-16"?><BOM><BO><AdmInfo><Object>-3</Object></AdmInfo><DSLAT/></BO></BOM>
where DSLAT is my user table.
Any suggestions?
Thanks in advance,
Piero Cannizzaro
Hello.
I had the same problem.
I solve it like this:
You must set the XmlExportType in CompanyObject to xet_ExportImportMode.
Then I used RecordSet (MyRecordSet).
Query it with my table and all the fields:
"select * from [table]"; (C++)
"select * from [@DSLAT]";
And then I set the object that i wanted to export recordset, like this:
Object->Browser->RecordSet = MyRecordSet; (C++)
Next export to xml field by field, moving object->browser to next record.
This is code (in C++):
_bstr_t Path;
int PathNumber=1;
Path= (_bstr_t)"MyPath";
while (Object->GetEof()!=VARIANT_TRUE)
{
Path+=(_bstr_t)PathNumer)
Object->SaveXml(&(Path.GetBSTR()));
++PathNumber; <- PathNumber=PathNumber+1
Object->Browser->MoveNext();
}
This solved my problem.
Hope it helps.
Sorry for my english.
Regards
Kamil Wydra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.