Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, February 19, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Data & Imports Forums - T-SQL & Queries
Forum to discuss general T-SQL questions and help with queries related to SalesLogix data. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to T-SQL & Queries | New ThreadView:  Search:  
 Author  Thread: Is it possible to export SLX data in XML format within SLX with v 6.1?
Swapnil
Posts: 46
 
Is it possible to export SLX data in XML format within SLX with v 6.1?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Dec 06 4:49 AM
fiogf49gjkf0d
Hi all,
Is it possible to export SLX data in XML format within SLX with v 6.1?

Thanks in advance!
[Reply][Quote]
Stuart
Posts: 178
 
Re: Is it possible to export SLX data in XML format within SLX with v 6.1?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Dec 06 6:22 AM
fiogf49gjkf0d
Assuming you are using MS SQL Server, you could try something like this to get started:

SELECT TOP 100 * FROM sysdba.ACCOUNT FOR XML AUTO

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Is it possible to export SLX data in XML format within SLX with v 6.1?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Dec 06 10:17 AM
fiogf49gjkf0d
Easy enough to dump XML from SLX data using .NET. Just fill a DataSet and save the underlying XML out to a file. Something like this:

public void ExportXml(string sql, string file)
{
OleDbConnection conn = new OleDbConnection(_slxconnstr);
try
{
conn.Open();

DataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter(sql, conn);
da.Fill(ds);
da.Dispose();

ds.WriteXml(file);
}
catch (Exception exp)
{
MessageBox.Show(exp.Message, exp.GetType().ToString());
}
finally
{
conn.Close();
}
}

' and to use...
ExportXml("select * from account", @"C:\MyAccounts.xml");


Something as easy and generic as that will take any SQL statement and export it to an XML file. If you're on v7 this would make a real quick and dirty .NET extension and could make this a very easy task.

If you wanted to write this from within a VBScript, you can use the MSXML classes which will already exist on each machine where SLX is installed. See more here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/7e831db8-9d0a-43ff-87e9-11382721eb99.asp

You can also do this easily using ADO, although without as much control over the XML. The Recordset object has a built in way to cache or persist a Recordset as XML. Gather the data in a Recordset, then call the Recordset's Save method specifying XML as the persist format:

Sub ExportXml(ByVal Query, ByVal FileName)
Dim rs

Set rs = Application.GetNewConnection.Execute(Query)
rs.Save FileName, adPersistXML ' <- adPersistXML has a value of 1 in case the enum isn't recognized in SLX VBScript
rs.Close
Set rs = Nothing
End Sub

' to use
ExportXml "select * from account", "C:\MyAccounts.xml"


Make sense?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Is it possible to export SLX data in XML format within SLX with v 6.1?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Dec 06 10:18 AM
fiogf49gjkf0d
Last I checked (on a 6.2.x version) FOR XML AUTO causes the SLX provider to choke. This would only work as long as you can make a direct connection to SQL.
[Reply][Quote]
Swapnil
Posts: 46
 
Re: Is it possible to export SLX data in XML format within SLX with v 6.1?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Jan 07 12:07 AM
fiogf49gjkf0d
Ryan,
Thanks for your help

One more doubt is it possible to invoke exe from SLX v6.1? If 'YES' then How?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Is it possible to export SLX data in XML format within SLX with v 6.1?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Jan 07 10:27 AM
fiogf49gjkf0d
If you have an .NET EXE that you simply want to launch, then look here: http://saleslogixblog.com/rfarley/archive/2004/02/10/331.aspx

If you have a .NET DLL that you need to invoke, then look here: http://www.huberstyle.com/viewblog.aspx?blogid=232



-Ryan
[Reply][Quote]
Swapnil
Posts: 46
 
Re: Is it possible to export SLX data in XML format within SLX with v 6.1?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Jan 07 2:49 AM
fiogf49gjkf0d
Ryan,
Thanks for your help.
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 2/19/2025 4:44:42 PM