ActiveReports Developers 7 Now Available in Beta!! (click for details)

SharpGrid Support

Started by solo_software at 11-02-2009 9:10 PM. Topic has 4 replies.

Print Search Rate
Sort Posts:    
   11-02-2009, 9:10 PM
solo_software is not online. Last active: 4/16/2011 2:46:02 PM solo_software

Not Ranked
Joined on 03-03-2006
Posts 15
XML to a recordset
Hello DD,

I have saved a XML file with the option:
SGrid1.ExportData App.Path & "\solosec.xml", sgFormatXML, sgExportFieldNames + sgExportOverwrite, ","


It indeed saves an XML file, but I want to load that XML into a Recordset. How can I go about this?


Your help is appreciated.
   Report 
   11-03-2009, 12:40 AM
Andrey - DD is not online. Last active: 8/25/2011 5:42:49 PM Andrey - DD

Top 25 Posts
Joined on 08-01-2007
Russia, Novosibirsk
Posts 671

DDStaff
Re: XML to a recordset
solo_software,

There should be several ways to do this, for example I've found this KB article from Microsoft:
How To Obtain an ADO Recordset from XML:
http://support.microsoft.com/kb/263247

Thank you,
Andrey T.
   Report 
   11-03-2009, 9:31 AM
solo_software is not online. Last active: 4/16/2011 2:46:02 PM solo_software

Not Ranked
Joined on 03-03-2006
Posts 15
Re: XML to a recordset
Thanks Andrey,

However this does not work as MS says:
Err number: -2147467259
Err Description: No se puede crear el Recordset. El origen XML está incompleto o no es válido.

This translates that the XML document created by the SharpGrid is not a Valid one or is incomplete.

I took all the XML files provided on the Samples from DD and all failed except the one called countries.xml. Guess what that is the only XML file on the samples that is not created by DD, all others failed to load.

The files that failed have this header:

-

The one that pass has a complete different format.

Can you please help me to convert an XML file created by DD to a recordset?

Thanks.
   Report 
   11-03-2009, 9:33 AM
solo_software is not online. Last active: 4/16/2011 2:46:02 PM solo_software

Not Ranked
Joined on 03-03-2006
Posts 15
Re: XML to a recordset
This is the header on all the ones that failed:

Data Dynamics #Grid exported data
Generated at 2009-11-02 22:38
Copyright © 2000-2005 Data Dynamics
   Report 
   11-03-2009, 10:43 AM
solo_software is not online. Last active: 4/16/2011 2:46:02 PM solo_software

Not Ranked
Joined on 03-03-2006
Posts 15
Re: XML to a recordset
Well this is yet another limitation for DD Sharpgrid. I give up on the XML DD provides as they are useless outside SharpGrid (the method does not provide a true schema)

For those of you moving data. I will suggest to use the CSV way. Save the file as a sgFormatCharSeparatedValue with the ExportData Method and read it back with the ImportData method sgFormatCharSeparatedValue option.

Then that CSV file can be handled by a recordset. You can see how here:
http://www.freevbcode.com/ShowCode.Asp?ID=2180

good luck
   Report 
GrapeCity » Product Support » SharpGrid Suppo... » Re: XML to a recordset

Privacy Policy | Copyright © 1997-2012 — GrapeCity, inc.
All trademarks mentioned are the property of their respective owners.