<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-6281645949032982951</id><updated>2009-10-15T03:49:38.784-07:00</updated><title type='text'>Sage Data Objects</title><subtitle type='html'>The Official blog of SageDataObjects.com</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-2305452845121957193</id><published>2009-04-03T01:14:00.000-07:00</published><updated>2009-04-03T01:15:18.134-07:00</updated><title type='text'>Official notification</title><content type='html'>&lt;center&gt; &lt;span style=""&gt;  &lt;h1&gt;Official Notification&lt;/h1&gt;  &lt;br /&gt;  As of 17th of February 2009, the websites www.sagedataobjects.com and www.omadataobjects.com have been   taken off-line in respect of a request from Sage (UK) Limited to cease offering our software without their  consent.  &lt;br /&gt;&lt;br /&gt; We would advise any body interested in Sage products to go directly to the official sage website at www.sage.co.uk &lt;/span&gt;  &lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-2305452845121957193?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/2305452845121957193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=2305452845121957193' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/2305452845121957193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/2305452845121957193'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2009/04/official-notification.html' title='Official notification'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-3100176226332631962</id><published>2009-02-01T07:03:00.000-08:00</published><updated>2009-02-01T07:16:05.233-08:00</updated><title type='text'>C#4, Dynamic Types and Sage</title><content type='html'>I was reading an article in this month's &lt;a href="http://www.vsj.co.uk/subscriptions/"&gt;VSJ&lt;/a&gt;, and I was interested to read about C# 4.0's new Dynamic type. This type is C#'s answer to the weakly typed objects of languages like Basic, PHP, etc., This gives some advantages when dealing with .NET interfaces that lay above COM infrastructures, especially the Sage Data Objects library.&lt;br /&gt;&lt;br /&gt;Therefore, with dynamics, code such as&lt;br /&gt;&lt;br /&gt;SageDataObject50.InvoicePost InvPost;&lt;br /&gt;       &lt;br /&gt;          InvPost = (SageDataObject50.InvoicePost)ws50.CreateObject("InvoicePost");&lt;br /&gt;&lt;br /&gt;can become:&lt;br /&gt;&lt;br /&gt;dynamic dInvoicePost = ws50.CreateObject("InvoicePost");&lt;br /&gt;&lt;br /&gt;The cast to InvoicePost will be done at runtime, and the code will still compile, even if you don't know what the return object of this particular CreateObject method can be cast to.&lt;br /&gt;&lt;br /&gt;The downside to this, as in every weakly typed language, is that many errors will not be spotted until runtime, and you may need to go through a process of trial-and-error to see what methods are available on a particular dynamic type.&lt;br /&gt;&lt;br /&gt;According to VSJ this method for invoking COM objects should actually be more efficient, and certainly more elegant than using reflection.&lt;br /&gt;&lt;br /&gt;Hopefully, I should be able to find a CTP download of C#4 to put together a code example.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-3100176226332631962?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/3100176226332631962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=3100176226332631962' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/3100176226332631962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/3100176226332631962'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2009/02/c4-dynamic-types-and-com.html' title='C#4, Dynamic Types and Sage'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-7264554813401931807</id><published>2009-01-24T13:34:00.000-08:00</published><updated>2009-01-24T13:42:39.700-08:00</updated><title type='text'>Using COM reflection</title><content type='html'>I read with interest this month's MSDN magazine article on &lt;a href="http://msdn.microsoft.com/en-us/magazine/2009.01.basicinstincts.aspx"&gt;COM reflection&lt;/a&gt;. The article provides an example of using reflection to uncover hidden properties and methods of the Speech library, and also explains how the elusive System.__ComObject can give up its goodies, so to speak.&lt;br /&gt;&lt;br /&gt;It works fine on the sample Speech API DLL on the site, however, it isn't so hot when it comes to Sage. I tried plugging in some common CLSID's from Sage's inner workings, but it gave up no further information. I then tried passing a System.__ComObject to it, with the following code;&lt;br /&gt;&lt;br /&gt;        Dim oUnknown As Object = o.GetCompanies("C:\Program Files\Sage\Accounts")&lt;br /&gt;        DumpCOMObject(oUnknown)&lt;br /&gt;&lt;br /&gt;However, it crashed out when IDispatch::GetTypeInfoCount returned 0. According to &lt;a href="http://msdn.microsoft.com/en-us/library/ms221674.aspx"&gt;MSDN reference&lt;/a&gt; this is done to prevent run-time inspection of the DLL, perhaps for security purposes.&lt;br /&gt;&lt;br /&gt;So, I guess this is a bit of an anti-pattern when it comes to Sage development, but I hope that this research saves another developer some time when it comes to trying to figure out the million dollar question 'what do I cast this object to now?'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-7264554813401931807?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/7264554813401931807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=7264554813401931807' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/7264554813401931807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/7264554813401931807'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2009/01/using-com-reflection.html' title='Using COM reflection'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-2140579948065382132</id><published>2008-11-27T10:59:00.001-08:00</published><updated>2008-11-27T11:07:57.972-08:00</updated><title type='text'>Connecting to SAGE using VBA</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Lm6rihutzTw/SS7uK82wksI/AAAAAAAAAGg/9i3yVUiRXSY/s1600-h/cscript.PNG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 469px; height: 159px;" src="http://4.bp.blogspot.com/_Lm6rihutzTw/SS7uK82wksI/AAAAAAAAAGg/9i3yVUiRXSY/s320/cscript.PNG" alt="" id="BLOGGER_PHOTO_ID_5273414085599335106" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I'm often asked if Sage Data Objects can be used with VBA (Visual Basic for Applications), for embedding into excel spreadsheets, and the like. The answer is of course, yes. As with all development with VBA, you loose the luxury of Intellisense, so development is alot harder than when using strongly-typed languages like VB.NET.&lt;br /&gt;&lt;br /&gt;But in a sense, it could be considered somewhat easier than languages that, one could say, are too strongly typed, such as C#. With it's refusal to support &lt;a href="http://en.wikipedia.org/wiki/Duck_typing"&gt;Duck-typing&lt;/a&gt;, that is almost vital in many instances to avoid the use of &lt;a href="http://en.wikipedia.org/wiki/Reflection_%28computer_science%29"&gt;reflection&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The below example can be used to print a list of customers registered in Sage.  The below code snippet should be saved as "customers.vbs", then it can be run at the command line by typing "cscript customers.vbs".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    Datapath = "C:\Line50\ACCDATA\"&lt;br /&gt;    Set SDOEngine = CreateObject("SDOEngine.5")&lt;br /&gt;    Set WS = SDOEngine.Workspaces.Add("Sage")&lt;br /&gt;    WS.Connect Datapath, "manager", "", "Sage"&lt;br /&gt;    Set srCustomer = WS.CreateObject("SalesRecord")&lt;br /&gt;    srCustomer.MoveFirst&lt;br /&gt;    Do&lt;br /&gt;        WScript.StdOut.Write srCustomer.Fields("Account_Ref") &amp;amp; Vbcrlf&lt;br /&gt;        srCustomer.MoveNext()&lt;br /&gt;    Loop until srCustomer.IsEof&lt;br /&gt;    WS.Disconnect&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-2140579948065382132?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/2140579948065382132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=2140579948065382132' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/2140579948065382132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/2140579948065382132'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/11/connecting-to-sage-using-vba.html' title='Connecting to SAGE using VBA'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Lm6rihutzTw/SS7uK82wksI/AAAAAAAAAGg/9i3yVUiRXSY/s72-c/cscript.PNG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-995555734579208793</id><published>2008-11-20T02:12:00.000-08:00</published><updated>2008-11-20T02:28:05.311-08:00</updated><title type='text'>Posting a stock transaction in VB.NET</title><content type='html'>In order to manage stock levels within Sage, it is often necessary to record the movement of stock in an out of the company, by way of Stock Transactions.&lt;br /&gt;&lt;br /&gt;Stock levels are managed automatically by Sage from the result of Sales or Purchases. However, these are not the only stock movements that can happen. Stock levels can be increased (Adustment In) with  deliveries and returns.  Stock levels can be reduced (Adustment Out) with non Invoiced sales and losses. Stock levels can also be reset using a stock-take.&lt;br /&gt;&lt;br /&gt;The following code creates an Adustment In (i.e. delivery) of 2 units of the first product found. At a cost price of £1.&lt;br /&gt;&lt;br /&gt;        Dim objStockPost As SageDataObject50.StockPost&lt;br /&gt;        objStockPost = ws50.CreateObject("StockPost")      &lt;br /&gt;        Dim objStockRec As SageDataObject50.StockRecord&lt;br /&gt;        objStockRec = ws50.CreateObject("StockRecord")&lt;br /&gt;        objStockRec.MoveFirst()      &lt;br /&gt;        objStockPost.Header.Fields("Stock_Code").Value = objStockRec.Fields.Item("Stock_Code").Value&lt;br /&gt;        Dim objStockTran As SageDataObject50.StockTran&lt;br /&gt;        objStockTran = objStockPost.Items.Add()&lt;br /&gt;        objStockTran.Fields.Item("Stock_Code").Value = objStockRec.Fields.Item("Stock_Code").Value&lt;br /&gt;        objStockTran.Fields.Item("Date").Value = DateTime.Now.ToString("MM/dd/yyyy")&lt;br /&gt;        objStockTran.Fields.Item("Type").Value = SageDataObject50.StockTransType.sdoAI&lt;br /&gt;        objStockTran.Fields.Item("Quantity").Value = CType(2, Double)&lt;br /&gt;        objStockTran.Fields.Item("Cost_Price").Value = CType(1, Double)&lt;br /&gt;        objStockTran.Fields.Item("Reference").Value = "Test Ref"&lt;br /&gt;        objStockTran.Fields.Item("Details").Value = "Test Transaction"&lt;br /&gt;        ' Update the StockPost object&lt;br /&gt;        Dim bFlag As Boolean&lt;br /&gt;        bFlag = objStockPost.Update()&lt;br /&gt;        If bFlag Then&lt;br /&gt;            MessageBox.Show("Success")&lt;br /&gt;        Else&lt;br /&gt;            MessageBox.Show("Failure")&lt;br /&gt;        End If&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-995555734579208793?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/995555734579208793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=995555734579208793' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/995555734579208793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/995555734579208793'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/11/posting-stock-transaction-in-vbnet.html' title='Posting a stock transaction in VB.NET'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-5909124104864386665</id><published>2008-10-23T02:29:00.000-07:00</published><updated>2008-10-23T02:32:46.059-07:00</updated><title type='text'>Disconnecting from Sage</title><content type='html'>It is always important to disconnect from Sage, once your operations on it are finished, either successfully or in error. otherwise the next person to log in, will be told of an existing login, and this can cause hassle for manual operators.&lt;br /&gt;&lt;br /&gt;Some users of the SDO have informed us of an intermittent problem, where the user can be left logged into Sage once a Disconnect() has been called. The brute-force solution to this was to delete the QUEUE.DTA file in the ACCDATA folder, but this is best avoided.&lt;br /&gt;&lt;br /&gt;A simple but novel solution was put forward by one of our users, to simply change the GUID in the Connect() parameters to the Username, and from all accounts, this seems to work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-5909124104864386665?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/5909124104864386665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=5909124104864386665' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/5909124104864386665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/5909124104864386665'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/10/disconnecting-from-sage.html' title='Disconnecting from Sage'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-2208907363106213316</id><published>2008-10-22T01:49:00.000-07:00</published><updated>2008-10-22T01:55:10.566-07:00</updated><title type='text'>Quirky IsEOF()</title><content type='html'>The IsEOF() function works a little different to how you'd expect it, and without understanding this function, you may end up missing your last entered customer, or invoice.&lt;br /&gt;&lt;br /&gt;IsEOF() is flagged true after reading the second-last record. That is to say, if you have 10 records, after reading record 9, then IsEOF() becomes true. This means you can still read record 10, but no more.&lt;br /&gt;&lt;br /&gt;The code example in the download from the website, actually misses this point, so here's how to fix it:&lt;br /&gt;&lt;br /&gt;SageDataObject50.SalesRecord srCustomer50 = (SageDataObject50.SalesRecord)ws50.CreateObject("SalesRecord");&lt;br /&gt;                        srCustomer50.MoveFirst();&lt;br /&gt;                        &lt;span style="color: rgb(153, 51, 0);"&gt;bool blnLast = false;&lt;/span&gt;&lt;br /&gt;                        while(true)&lt;br /&gt;                        {&lt;br /&gt;                            strDescription = srCustomer50.Fields.Item(ref objDescription).Value.ToString();&lt;br /&gt;                            this.lvCustomer.Items.Add(strDescription);&lt;br /&gt;                            srCustomer50.MoveNext();&lt;br /&gt;                          &lt;span style="color: rgb(102, 0, 0);"&gt;  if (blnLast) break;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;                            blnLast = srCustomer50.IsEOF();&lt;/span&gt;&lt;br /&gt;                        }&lt;br /&gt;                        break;&lt;br /&gt;&lt;br /&gt;The code added is highlighted in brown. Note how IsEOF is flagged before the last record is read.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-2208907363106213316?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/2208907363106213316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=2208907363106213316' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/2208907363106213316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/2208907363106213316'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/10/quirky-iseof.html' title='Quirky IsEOF()'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-559066306899717956</id><published>2008-10-08T02:27:00.000-07:00</published><updated>2008-10-08T02:32:57.437-07:00</updated><title type='text'>Type Safety with Sage</title><content type='html'>One problem that is often encountered by developers using the Sage Data Objects component is the issue of type safety. If you set the wrong type to a value of a field the software will either throw a runtime exception or, ignore the value you set in. Runtime exceptions can be seen easily, but ignored values are more problematic.&lt;br /&gt;&lt;br /&gt;Here is an example of the problem, in Visual Basic.NET&lt;br /&gt;&lt;br /&gt;InvPost.Header("Items_Net").value = 13 &lt;div&gt; &lt;p&gt;&lt;span&gt;? InvPost.Header("Items_Net").value&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;4.7229610327708223E+275 {Double}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;[Double]: 4.7229610327708223E+275 {Double}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;InvPost.Header("Items_Net").value = CType(13,Double)&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;? InvPost.Header("Items_Net").value&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;13.0 {Double}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;[Double]: 13.0 {Double}&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;Here, Items_Net is expecting a floating point value, but when assigned with an integer, it ignores the value, and does not throw an exception. Converting the type to a double, and the code works as expected.&lt;br /&gt;&lt;br /&gt;To avoid this, you should be familiar with the types of all the fields that you use, and to do so, you should study the schema for your particular version of Sage, as explained in this link&lt;br /&gt;&lt;a href="http://sagedataobjects.blogspot.com/2008/05/exploring-sage-data-schema.html"&gt;http://sagedataobjects.blogspot.com/2008/05/exploring-sage-data-schema.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-559066306899717956?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/559066306899717956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=559066306899717956' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/559066306899717956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/559066306899717956'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/10/type-safety-with-sage.html' title='Type Safety with Sage'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-6058918495395379241</id><published>2008-10-02T01:26:00.000-07:00</published><updated>2008-10-02T01:29:59.288-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic 6'/><title type='text'>Adding and Removing Customers with Visual Basic</title><content type='html'>Although Visual Basic 6 is quite an aged product now, but many software houses continue to use it, as much as they continue to use old versions of Sage. Here is a handy example program in Visual Basic 6 for adding and removing customers (with source code) for download here&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.sagedataobjects.com/sagecustomersvb.zip"&gt;http://www.sagedataobjects.com/sagecustomersvb.zip&lt;/a&gt; (3Kb)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-6058918495395379241?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/6058918495395379241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=6058918495395379241' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/6058918495395379241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/6058918495395379241'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/10/adding-and-removing-customers-with.html' title='Adding and Removing Customers with Visual Basic'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-655709927715871607</id><published>2008-09-18T02:09:00.001-07:00</published><updated>2008-09-18T02:12:50.273-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Departments'/><title type='text'>Reading and Updating Departments in Sage</title><content type='html'>In Sage, products are often assigned to Departments, for example, a food wholesaler might have a department for frozen foods, and one for fresh foods.&lt;br /&gt;&lt;br /&gt;Reading and updating departments in Sage via Sage Data Objects is easy, and here's how.&lt;br /&gt;&lt;br /&gt;Reading departments:&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;Dim&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; IDepartment &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;As&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;  SageDataObject50.Department&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;Dim&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; strDescription &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;As&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;String&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;IDepartment = &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;DirectCast&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;(ws50.CreateObject("DepartmentData"), SageDataObject50.Department)&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;Dim&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; i &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;As&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; Int16&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;For&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; i = 0 &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;To&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; 100&lt;/span&gt;&lt;/p&gt; &lt;p style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;IDepartment.Read(i)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;color:#008000;"  &gt;&lt;span style="font-size:85%;"&gt;strDescription  = IDepartment.Fields.Item("NAME").Value.ToString()&lt;/span&gt;&lt;/span&gt; &lt;p style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;Me.lvDepartments.Items.Add(strDescription)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt; &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;Next&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;To update them, you just use the write(int) method.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;Dim&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; IDepartment &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;As&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;  SageDataObject50.Department&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;Dim&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; strDescription &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;As&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;String&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;IDepartment = &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;DirectCast&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;(ws50.CreateObject("DepartmentData"), SageDataObject50.Department)&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;Dim&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; i &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;As&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; Int16&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;For&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; i = 0 &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;To&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt; 100&lt;/span&gt;&lt;/p&gt; &lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;IDepartment.Fields.Item("NAME").Value = "RESET"&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;IDepartment.Write(i)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;Next&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-655709927715871607?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/655709927715871607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=655709927715871607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/655709927715871607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/655709927715871607'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/09/reading-and-updating-departments-in.html' title='Reading and Updating Departments in Sage'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-4851324933132454781</id><published>2008-09-02T13:37:00.000-07:00</published><updated>2008-09-02T13:40:59.759-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ODBC'/><title type='text'>Read/Write ODBC connection for Sage</title><content type='html'>Sage ships with a read only ODBC connection, which is useful for doing linked-server joins with SQL server, or similar databases. Or, a quick way to import into Excel, for instance. However, the main limitation of this, is that it is only read-only, you cannot change any data within Sage.&lt;br /&gt;&lt;br /&gt;A company we were speaking to offer a ODBC SDK on a 15 day trial basis, and we'd be interested in hearing from anyone who can integrate our component with this SDK to create a read/write ODBC connection with Sage.&lt;br /&gt;&lt;br /&gt;Here's the link to the ODBC SDK&lt;br /&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;a href="http://www.datadirect.com/downloads/registration/sdk_eval/index.ssp"&gt;http://www.datadirect.com/downloads/registration/sdk_eval/index.ssp&lt;/a&gt;&lt;o:p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-4851324933132454781?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/4851324933132454781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=4851324933132454781' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/4851324933132454781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/4851324933132454781'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/09/readwrite-odbc-connection-for-sage.html' title='Read/Write ODBC connection for Sage'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-1170801879135014583</id><published>2008-08-26T13:08:00.000-07:00</published><updated>2008-12-14T06:48:16.316-08:00</updated><title type='text'>Schema for Sage Line 50 Financial Controller</title><content type='html'>We're working through the schema of the Sage Line 50 Financial controller version, and thought that as a reference for Sage developers to publish our schema online&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.sagedataobjects.com/line50financialcontroller.asp"&gt;http://www.sagedataobjects.com/line50financialcontroller.asp&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-1170801879135014583?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/1170801879135014583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=1170801879135014583' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/1170801879135014583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/1170801879135014583'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/08/schema-for-sage-line-50-financial.html' title='Schema for Sage Line 50 Financial Controller'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-16998606951386277</id><published>2008-07-30T02:05:00.000-07:00</published><updated>2008-07-30T02:07:08.236-07:00</updated><title type='text'>Third party integration</title><content type='html'>If you recieve an error "Sage Data Objects is not registered, please contact the supplier of this application" within a day or so of trying the trail version, don't panic, simply activate third party integration as follows:&lt;br /&gt;&lt;br /&gt;&lt;span id="ctl00_ContentPlaceHolder1_FormView1_ResolutionLabel" class="ShowContent"&gt;1. Open Sage and click the Tools | Activation | Enable Third Party Integration menu option.&lt;br /&gt;&lt;br /&gt;3. A screen will appear with a phone number to call; request the SDO Serial Number and Activation Key from the Sage customer services agent, enter the details in the textboxes provided and click the Register button.&lt;br /&gt;&lt;br /&gt;Note: when calling the phone number the Sage customer services agent will usually ask you for you Sage Line 50 Serial Number (see the Help | About menu for this), your company name, first line of your address and / or postcode. Attaining the SDO Serial Number and Activation Key is a completely free service (apart from the price of the call) and will typically take no long than 5 minutes. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-16998606951386277?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/16998606951386277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=16998606951386277' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/16998606951386277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/16998606951386277'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/07/third-party-integration.html' title='Third party integration'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-8832978309398878293</id><published>2008-07-23T02:42:00.000-07:00</published><updated>2008-07-23T02:43:53.978-07:00</updated><title type='text'>Read Purchase orders from Sage in VB.NET</title><content type='html'>Reading purchase orders from Sage is very similar to reading invoices (sales orders) from sage, but once again, the objects you use are prefixed with "pop" (purchase order processing), and you use a different set of schemas.&lt;br /&gt;&lt;br /&gt;Here's the code:&lt;br /&gt;&lt;br /&gt; Private Sub btnPurchases_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPurchases.Click&lt;br /&gt;        Dim strOrderNumber As String&lt;br /&gt;        Dim prPurchase As SageDataObject50.PopRecord = DirectCast(ws50.CreateObject("PopRecord"), SageDataObject50.PopRecord)&lt;br /&gt;        prPurchase.MoveFirst()&lt;br /&gt;&lt;br /&gt;        While Not prPurchase.IsEOF()&lt;br /&gt;            ' For A Full list of available fields go to:&lt;br /&gt;            ' http://www.sagedataobjects.com/line50v9schema.asp&lt;br /&gt;            ' and see the PURCHASE_ORDER Table&lt;br /&gt;            strOrderNumber = prPurchase.Fields.Item("ORDER_NUMBER").Value.ToString()&lt;br /&gt;            Dim popItem As SageDataObject50.PopItem&lt;br /&gt;            popItem = CType(prPurchase.Link, SageDataObject50.PopItem)&lt;br /&gt;            popItem.MoveFirst()&lt;br /&gt;            Do&lt;br /&gt;                ' For A Full list of available fields go to:&lt;br /&gt;                ' http://www.sagedataobjects.com/line50v9schema.asp&lt;br /&gt;                ' and see the POP_ITEM Table&lt;br /&gt;                Dim strLineItemText As String&lt;br /&gt;                strLineItemText = popItem.Fields.Item("TEXT").Value.ToString()&lt;br /&gt;            Loop While popItem.MoveNext()&lt;br /&gt;            Me.lvPurchases.Items.Add(strOrderNumber)&lt;br /&gt;            prPurchase.MoveNext()&lt;br /&gt;        End While&lt;br /&gt;    End Sub&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-8832978309398878293?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/8832978309398878293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=8832978309398878293' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/8832978309398878293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/8832978309398878293'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/07/read-purchase-orders-from-sage-in-vbnet.html' title='Read Purchase orders from Sage in VB.NET'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-4145971081217390352</id><published>2008-07-19T05:55:00.000-07:00</published><updated>2008-07-19T06:00:04.429-07:00</updated><title type='text'>Post a purchase order in VB.NET</title><content type='html'>Posting a purchase order in VB.NET is similar to posting an invoice, you're using Pop-prefixed classes rather than Invoice-Prefix classes, and using a different underlying schema, but otherwise, it's more or less the same, here is a code example:&lt;br /&gt;Private Sub btnPurchaseOrderPost_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPurchaseOrderPost.Click&lt;br /&gt;        Dim PurchaseOrderRecord As SageDataObject50.PopRecord = ws50.CreateObject("PopRecord")&lt;br /&gt;        Dim PurchaseOrderPost As SageDataObject50.PopPost = ws50.CreateObject("PopPost")&lt;br /&gt;&lt;br /&gt;        'Set the type of invoice so we can find the next available number&lt;br /&gt;        'PurchaseOrderPost.Type = SageDataObject50.LedgerType.sdoLedgerService&lt;br /&gt;&lt;br /&gt;        'Loop for Number of Items on the Invoice&lt;br /&gt;        Dim PurchaseOrderItem As SageDataObject50.PopItem = PurchaseOrderPost.Items.Add()&lt;br /&gt;&lt;br /&gt;        ' This is the text for the line&lt;br /&gt;&lt;br /&gt;        PurchaseOrderItem.Fields.Item("Text").Value = "Invoice Line Text"&lt;br /&gt;        PurchaseOrderItem.Fields.Item("Service_Item_Lines").Value = CLng(1)&lt;br /&gt;        PurchaseOrderItem.Fields.Item("Net_Amount").Value = CLng(100)&lt;br /&gt;        PurchaseOrderItem.Fields.Item("Full_Net_Amount").Value = CLng(100)&lt;br /&gt;        PurchaseOrderItem.Fields.Item("Tax_Amount").Value = CLng(0)&lt;br /&gt;        PurchaseOrderItem.Fields.Item("Nominal_Code").Value = "4000" 'Sales&lt;br /&gt;        PurchaseOrderItem.Fields.Item("Tax_Code").Value = "T9"&lt;br /&gt;        PurchaseOrderItem.Fields.Item("Tax_Rate").Value = CDec(0)&lt;br /&gt;&lt;br /&gt;        'Populate  Header Information&lt;br /&gt;        ' see http://www.sagedataobjects.com/line50v9schema.asp&lt;br /&gt;        ' PURCHASE_ORDER for schema&lt;br /&gt;        PurchaseOrderPost.Header("Order_Date").value = DateTime.Now.ToString("MM/dd/yyyy")&lt;br /&gt;        PurchaseOrderPost.Header("Notes_1").value = "Notes 1"&lt;br /&gt;        PurchaseOrderPost.Header("Notes_2").value = ""&lt;br /&gt;        PurchaseOrderPost.Header("Notes_3").value = ""&lt;br /&gt;        PurchaseOrderPost.Header("Taken_By").value = ""&lt;br /&gt;        PurchaseOrderPost.Header("Order_Number").value = ""&lt;br /&gt;        PurchaseOrderPost.Header("Payment_Ref").value = ""&lt;br /&gt;        PurchaseOrderPost.Header("Global_Nom_Code").value = ""&lt;br /&gt;        PurchaseOrderPost.Header("Global_Details").value = ""&lt;br /&gt;        PurchaseOrderPost.Header("Items_Net").value = CDec(100)&lt;br /&gt;        PurchaseOrderPost.Header("Items_Tax").value = CDec(0)&lt;br /&gt;&lt;br /&gt;        'Read the first customer&lt;br /&gt;        PurchaseOrderRecord.MoveFirst()&lt;br /&gt;        PurchaseOrderPost.Header("Account_Ref").value = CStr(PurchaseOrderRecord.Fields.Item("Account_Ref").Value)&lt;br /&gt;        PurchaseOrderPost.Header("Name").value = CStr(PurchaseOrderRecord.Fields.Item("Name").Value)&lt;br /&gt;        PurchaseOrderPost.Header("Address_1").value = CStr(PurchaseOrderRecord.Fields.Item("Address_1").Value)&lt;br /&gt;        PurchaseOrderPost.Header("Address_2").value = CStr(PurchaseOrderRecord.Fields.Item("Address_2").Value)&lt;br /&gt;        PurchaseOrderPost.Header("Address_3").value = CStr(PurchaseOrderRecord.Fields.Item("Address_3").Value)&lt;br /&gt;        PurchaseOrderPost.Header("Address_4").value = CStr(PurchaseOrderRecord.Fields.Item("Address_4").Value)&lt;br /&gt;        PurchaseOrderPost.Header("Address_5").value = CStr(PurchaseOrderRecord.Fields.Item("Address_5").Value)&lt;br /&gt;        PurchaseOrderPost.Header("Del_Address_1").value = CStr(PurchaseOrderRecord.Fields.Item("Del_Address_1").Value)&lt;br /&gt;        PurchaseOrderPost.Header("Del_Address_2").value = CStr(PurchaseOrderRecord.Fields.Item("Del_Address_2").Value)&lt;br /&gt;        PurchaseOrderPost.Header("Del_Address_3").value = CStr(PurchaseOrderRecord.Fields.Item("Del_Address_3").Value)&lt;br /&gt;        PurchaseOrderPost.Header("Del_Address_4").value = CStr(PurchaseOrderRecord.Fields.Item("Del_Address_4").Value)&lt;br /&gt;        PurchaseOrderPost.Header("Del_Address_5").value = CStr(PurchaseOrderRecord.Fields.Item("Del_Address_5").Value)&lt;br /&gt;        PurchaseOrderPost.Header("Contact_Name").value = CStr(PurchaseOrderRecord.Fields.Item("Contact_Name").Value)&lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;        PurchaseOrderPost.Header("Order_Number").value = CLng(101)&lt;br /&gt;&lt;br /&gt;      &lt;br /&gt;        If PurchaseOrderPost.Update Then&lt;br /&gt;            MessageBox.Show("Purchase Order Created Successfully")&lt;br /&gt;        Else&lt;br /&gt;            MessageBox.Show("Purchase Order NOT Created")&lt;br /&gt;        End If&lt;br /&gt;&lt;br /&gt;    End Sub&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-4145971081217390352?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/4145971081217390352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=4145971081217390352' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/4145971081217390352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/4145971081217390352'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/07/post-purchase-order-in-vbnet.html' title='Post a purchase order in VB.NET'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-2198396458582158199</id><published>2008-07-17T13:21:00.000-07:00</published><updated>2008-07-17T13:27:02.766-07:00</updated><title type='text'>Posting an Invoice in C#</title><content type='html'>In many respects the Sage Data Objects library is much easier to use from VB.NET than C#, why?, because VB.NET deals with object casting in a much less strict way. This way, you can say:&lt;br /&gt;&lt;br /&gt;InvItem.Fields.Item("Text").Value = "Invoice Line Text"&lt;br /&gt;&lt;br /&gt;Rather than&lt;br /&gt;&lt;br /&gt;object TEXT = "Text";&lt;br /&gt;InvItem.Fields.Item(ref TEXT).Value = "Invoice Line Text";&lt;br /&gt;&lt;br /&gt;Further more, since the internals of Sage hide many implementation details, you may not know what class an object is, since .NET will only report that it's a ComObject, Nothing more.&lt;br /&gt;&lt;br /&gt;In most cases, we'd recommend that you create a stub library in VB.NET to host our component, and provide services to your C# Application, however, if that is not possible, then here is how to carry out a common task in sage, - posting an Invoice&lt;br /&gt;&lt;br /&gt;public void CreateInvoice(DateTime InvoiceDate, int InvoiceNumber)&lt;br /&gt;        {&lt;br /&gt;            SageDataObject50.InvoicePost InvPost;&lt;br /&gt;           &lt;br /&gt;            InvPost = (SageDataObject50.InvoicePost)ws50.CreateObject("InvoicePost");&lt;br /&gt;&lt;br /&gt;            InvPost.Type =(SageDataObject50.InvoiceType)SageDataObject50.LedgerType.sdoLedgerInvoice;&lt;br /&gt;            object Invoice_Number = "Invoice_Number";&lt;br /&gt;            object Invoice_Date = "Invoice_Date";&lt;br /&gt;&lt;br /&gt;            SageDataObject50.IFields ifHeaderFields = null;&lt;br /&gt;           &lt;br /&gt;            Type t = InvPost.Header.GetType();&lt;br /&gt;&lt;br /&gt;            Object oFields = t.InvokeMember("Fields",&lt;br /&gt;                                BindingFlags.GetProperty&lt;br /&gt;                                , null, InvPost.Header, new Object[0]);&lt;br /&gt;&lt;br /&gt;            ifHeaderFields = (SageDataObject50.IFields)oFields;&lt;br /&gt;&lt;br /&gt;            ifHeaderFields.Item(ref Invoice_Number).Value = InvoiceNumber;&lt;br /&gt;            ifHeaderFields.Item(ref Invoice_Date).Value = InvoiceDate.ToString("MM/dd/yyyy");&lt;br /&gt;           &lt;br /&gt;            t = InvPost.Items.GetType();&lt;br /&gt;&lt;br /&gt;            Object oItem = t.InvokeMember("Add",&lt;br /&gt;                    BindingFlags.InvokeMethod,&lt;br /&gt;                    null,&lt;br /&gt;                    InvPost.Items,&lt;br /&gt;                    new Object[0]);&lt;br /&gt;           &lt;br /&gt;             SageDataObject50.InvoiceItem InvItem;&lt;br /&gt;             InvItem = (SageDataObject50.InvoiceItem)oItem;&lt;br /&gt;&lt;br /&gt;             // This is the text for the line&lt;br /&gt;            InvItem.Text = "Description";&lt;br /&gt;            object TEXT = "Text";&lt;br /&gt;            object SERVICE_ITEM_LINES = "Service_Item_Lines";&lt;br /&gt;            object NET_AMOUNT = "Net_Amount";&lt;br /&gt;            object FULL_NET_AMOUNT = "Full_Net_Amount";&lt;br /&gt;            object TAX_AMOUNT = "Tax_Amount";&lt;br /&gt;            object NOMINAL_CODE = "Nominal_Code";&lt;br /&gt;            object TAX_CODE = "Tax_Code";&lt;br /&gt;            object TAX_RATE = "Tax_Rate";&lt;br /&gt;&lt;br /&gt;            InvItem.Fields.Item(ref TEXT).Value = "Invoice Line Text";&lt;br /&gt;            InvItem.Fields.Item(ref SERVICE_ITEM_LINES).Value = (double)1;&lt;br /&gt;            InvItem.Fields.Item(ref NET_AMOUNT).Value = (double)100;&lt;br /&gt;            InvItem.Fields.Item(ref FULL_NET_AMOUNT).Value = (double)100;&lt;br /&gt;            InvItem.Fields.Item(ref TAX_AMOUNT).Value = (double)0;&lt;br /&gt;            InvItem.Fields.Item(ref NOMINAL_CODE).Value = "4000";&lt;br /&gt;            InvItem.Fields.Item(ref TAX_CODE).Value = "T9";&lt;br /&gt;            InvItem.Fields.Item(ref TAX_RATE).Value = (decimal)0;&lt;br /&gt;           &lt;br /&gt;            if (!InvPost.Update())&lt;br /&gt;            {&lt;br /&gt;                MessageBox.Show("Unable to create invoice");&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                MessageBox.Show("Invoice Created");&lt;br /&gt;            }&lt;br /&gt;        }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-2198396458582158199?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/2198396458582158199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=2198396458582158199' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/2198396458582158199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/2198396458582158199'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/07/posting-invoice-in-c.html' title='Posting an Invoice in C#'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-3591034604243885268</id><published>2008-06-27T13:23:00.000-07:00</published><updated>2008-06-27T13:26:02.021-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SalesRecord sage'/><title type='text'>Updating a customer's delivery address</title><content type='html'>This is quite a simple piece of code, but it was asked for by one of our development community. Basically how to update a customer's delivery address from code, so here it is:&lt;br /&gt;&lt;br /&gt;    Private Sub btnUpdateDeliveryAddress_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdateDeliveryAddress.Click&lt;br /&gt;        Dim SalesRecord As SageDataObject50.SalesRecord = DirectCast(ws50.CreateObject("SalesRecord"), SageDataObject50.SalesRecord)&lt;br /&gt;        SalesRecord.MoveFirst()&lt;br /&gt;        SalesRecord.Edit()&lt;br /&gt;        SalesRecord.Fields.Item("DEL_ADDRESS_1").Value = "10 William Drive"&lt;br /&gt;        SalesRecord.Fields.Item("DEL_ADDRESS_2").Value = "Wallaceville"&lt;br /&gt;        SalesRecord.Fields.Item("DEL_ADDRESS_3").Value = "co. Durham"&lt;br /&gt;        SalesRecord.Fields.Item("DEL_ADDRESS_4").Value = "England"&lt;br /&gt;        SalesRecord.Fields.Item("DEL_ADDRESS_5").Value = "NT48 9LH"&lt;br /&gt;        SalesRecord.Update()&lt;br /&gt;    End Sub&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-3591034604243885268?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/3591034604243885268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=3591034604243885268' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/3591034604243885268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/3591034604243885268'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/06/updating-customers-delivery-address.html' title='Updating a customer&apos;s delivery address'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-1305254657845103691</id><published>2008-06-04T13:56:00.001-07:00</published><updated>2008-06-06T01:05:57.654-07:00</updated><title type='text'>Displaying the IFields Collection</title><content type='html'>This handy utility was submitted by one of our users, to display the list of fields available within an InvoiceItem. The code could easily be adapted for any of the objects within Sage.&lt;br /&gt;&lt;br /&gt;&lt;div dir="ltr" align="left"&gt;&lt;span class="962580512-03062008"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Arial;"&gt;/&lt;span style="font-family:courier new;"&gt;/ This class is only to display the field information  in a DataGrid  or GridView&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div  dir="ltr" align="left" style="font-family:courier new;"&gt;&lt;span class="962580512-03062008"&gt;private class  FieldNameInfo&lt;br /&gt;  {&lt;br /&gt;  private string _name;&lt;br /&gt;  private string  _desc;&lt;br /&gt;  private string _typ;&lt;br /&gt;  private string _len;&lt;/span&gt;&lt;/div&gt; &lt;div style="font-family: courier new;"&gt; &lt;/div&gt; &lt;div  dir="ltr" align="left" style="font-family:courier new;"&gt;&lt;span class="962580512-03062008"&gt;&lt;span style="font-size:85%;"&gt;   public FieldNameInfo(string Name, string Desc, string Typ, string Len)&lt;br /&gt;  {&lt;br /&gt;   _name = Name;&lt;br /&gt;   _desc = Desc;&lt;br /&gt;   _typ =  Typ;&lt;br /&gt;   _len = Len;&lt;br /&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style="font-family: courier new;"&gt; &lt;/div&gt; &lt;div  dir="ltr" align="left" style="font-family:courier new;"&gt;&lt;span class="962580512-03062008"&gt;&lt;span style="font-size:85%;"&gt;   public string Name&lt;br /&gt;  {&lt;br /&gt;   get { return _name;  }&lt;br /&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style="font-family: courier new;"&gt; &lt;/div&gt; &lt;div  dir="ltr" align="left" style="font-family:courier new;"&gt;&lt;span class="962580512-03062008"&gt;&lt;span style="font-size:85%;"&gt;   public string Description&lt;br /&gt;  {&lt;br /&gt;   get { return _desc;  }&lt;br /&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style="font-family: courier new;"&gt; &lt;/div&gt; &lt;div  dir="ltr" align="left" style="font-family:courier new;"&gt;&lt;span class="962580512-03062008"&gt;&lt;span style="font-size:85%;"&gt;   public string Lenth&lt;br /&gt;  {&lt;br /&gt;   get { return _len;  }&lt;br /&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style="font-family: courier new;"&gt; &lt;/div&gt; &lt;div  dir="ltr" align="left" style="font-family:courier new;"&gt;&lt;span class="962580512-03062008"&gt;&lt;span style="font-size:85%;"&gt;   public string Typ&lt;br /&gt;  {&lt;br /&gt;   get { return _typ;  }&lt;br /&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style="font-family: courier new;"&gt; &lt;/div&gt; &lt;div  dir="ltr" align="left" style="font-family:courier new;"&gt;&lt;span class="962580512-03062008"&gt;&lt;span style="font-size:85%;"&gt;  }&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div  dir="ltr" align="left" style="font-family:courier new;"&gt;&lt;span class="962580512-03062008"&gt;&lt;span style="color: rgb(0, 0, 255);font-size:85%;" &gt; &lt;span style="color: rgb(0, 0, 0);"&gt; private void  checkFields()&lt;br /&gt; {&lt;br /&gt;  lblTable.Text = "Invoice Item";&lt;br /&gt;  ArrayList  listFields = new ArrayList();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style="font-family: courier new;"&gt; &lt;/div&gt; &lt;div  dir="ltr" align="left" style="font-family:courier new;"&gt;&lt;span class="962580512-03062008"&gt;&lt;span style="font-size:85%;"&gt;   sdo120= new  SageDataObject120.SageDataObjects();&lt;br /&gt;ws120 = sdo120.GetWorkSpace();&lt;br /&gt;  try&lt;br /&gt;  {&lt;br /&gt;   if (  ws120.Connect(ConfigurationSettings.AppSettings["SagePath"],  ConfigurationSettings.AppSettings["SageUser"],  ConfigurationSettings.AppSettings["SagePassword"], "ChkFields")  )&lt;br /&gt;   {&lt;br /&gt;    SageDataObject120.SopItem myRec =  (SageDataObject120.SopItem)ws120.CreateObject("InvoiceItem");&lt;br /&gt;    myRec.MoveFirst();&lt;br /&gt;    SageDataObject120.IFields  myFields = myRec.Fields;&lt;br /&gt;    foreach (SageDataObject120.IField myFld in  myFields)&lt;br /&gt;    {&lt;br /&gt;     FieldNameInfo fni = new  FieldNameInfo(myFld.Name.ToString(), myFld.Description.ToString(),  myFld.Type.ToString(),  myFld.Length.ToString());&lt;br /&gt;     listFields.Add(fni);&lt;br /&gt;   &lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;  catch(Exception  ex)&lt;br /&gt;  {&lt;br /&gt;  } &lt;br /&gt;  finally&lt;br /&gt;  {&lt;br /&gt;   ws120.Disconnect();&lt;br /&gt;  }&lt;br /&gt;  listFieldsId.DataSource  = listFields;&lt;br /&gt;  listFieldsId.DataBind();&lt;br /&gt; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style="font-family: courier new;"&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-1305254657845103691?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/1305254657845103691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=1305254657845103691' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/1305254657845103691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/1305254657845103691'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/06/displaying-ifields-collection.html' title='Displaying the IFields Collection'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-4642367030265459876</id><published>2008-05-06T02:45:00.000-07:00</published><updated>2008-05-10T10:01:27.278-07:00</updated><title type='text'>Exploring the Sage Data Schema</title><content type='html'>Sage ships with an ODBC driver that can be used to provide read-only access to the underlying data tables in Sage, the SDO (Sage Data Objects) can provide read-write access to these tables, but often, it's hard to know which field you need to edit. Therefore this ODBC driver can come in handy listing tables, columns, and hints for what each field is for.&lt;br /&gt;&lt;br /&gt;After the installation of sage, a DSN should be setup, if you go to Start Contol Panel Administrative Tools ODBC Manager, then select "System DSN", you should see a DSN called, "SageLine50v9" or similar.&lt;br /&gt;&lt;br /&gt;If you download a free utility called DSN2CSV here &lt;a href="http://bitdaddys.com/dsn2csv.html"&gt;http://bitdaddys.com/dsn2csv.html&lt;/a&gt;&lt;br /&gt;and, from the command prompt type:&lt;br /&gt;&lt;br /&gt;dsn2csv "SageLine50v9" * "Manager" ""&lt;br /&gt;&lt;br /&gt;A sample schema from Line 50 version 9 can be found here: &lt;a href="http://www.sagedataobjects.com/line50v9schema.asp"&gt;http://www.sagedataobjects.com/line50v9schema.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A sample schema from Line 50 version 13 can be found here:&lt;br /&gt;&lt;a href="http://www.sagedataobjects.com/line50v13schema.asp"&gt;http://www.sagedataobjects.com/line50v13schema.asp&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-4642367030265459876?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/4642367030265459876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=4642367030265459876' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/4642367030265459876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/4642367030265459876'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/05/exploring-sage-data-schema.html' title='Exploring the Sage Data Schema'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-6116088535262647378</id><published>2008-04-19T13:35:00.000-07:00</published><updated>2008-04-19T13:53:12.722-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sage Data Objects'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Sage'/><title type='text'>Connecting Sage with JAVA</title><content type='html'>&lt;span style="font-size:180%;"&gt;Connecting Sage with JAVA&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It is possible to connect Sage with Java via Sage Data Objects, and a Java-COM bridge "EZ-JCom". You will need to download the SageDataObjects library from &lt;a href="http://www.sagedataobjects.com/"&gt;http://www.sagedataobjects.com/&lt;/a&gt; and the SageForJava Library from (&lt;a href="http://www.sagedataobjects.com/javasdo/sageforjava.zip"&gt;http://www.sagedataobjects.com/javasdo/sageforjava.zip&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;After downloading and installing the SageDataObjects library, and unzipping the SageForJava Library, you will need to select the version of Sage you want to connect to, for example, version 14, Copy the File, JSDOENG140.DLL from the SDOENG140Java Folder., and place it in your Windows\System32 Folder.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Creating your Java Application&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;br /&gt;Using your preferred IDE, add a reference to the JAR file, for the selected version of sage, for example, with JCreator, Press Project &gt; Project Settings &gt; Required Libraries &gt; New &gt; Add &gt; Add Archive. Then Select JSDOENG140.JAR&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Coding:&lt;/span&gt;&lt;br /&gt;The following code will connect to sage, and list all current customers on the screen. the code is available as part of the Java SDO download shown above.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:78%;"&gt;&lt;span style="font-size:100%;"&gt;import ezjcom.*;&lt;br /&gt;&lt;br /&gt;public class JSage {&lt;br /&gt;&lt;br /&gt;public static void main(String[] args)&lt;br /&gt;{&lt;br /&gt;SageDataObjects50.SDOEngine SDO = null;&lt;br /&gt;SageDataObjects50.IWorkSpace IWS = null;&lt;br /&gt;SageDataObjects50.ISalesRecord ISR = null;&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;// This should be the Installation location of the Sage software&lt;br /&gt;String strACCData = "c:\\line50\\accdata\\";&lt;br /&gt;// The default login to Sage is MANAGER&lt;br /&gt;String strUsername = "MANAGER";&lt;br /&gt;String strPassword = "";&lt;br /&gt;&lt;br /&gt;// Create a new Sage Data Objects Engine object&lt;br /&gt;SDO = new SageDataObjects50.SDOEngine();&lt;br /&gt;SageDataObjects50.ISDOEngine ISDO = SDO.getISDOEngine();&lt;br /&gt;SageDataObjects50.Workspaces WSS = ISDO.getWorkspaces();&lt;br /&gt;SageDataObjects50.IWorkspaces IWSS = WSS.getIWorkspaces();&lt;br /&gt;&lt;br /&gt;// Create a Workspace from the Engine&lt;br /&gt;IWS = (SageDataObjects50.IWorkSpace)IWSS.Add("MyConnection");&lt;br /&gt;&lt;br /&gt;// Connect to Sage&lt;br /&gt;IWS.Connect(strACCData, strUsername, strPassword, "MyConnection");&lt;br /&gt;&lt;br /&gt;// Have the Workspace get the first Sales Record&lt;br /&gt;SageDataObjects50.ISDORecord ISDOR = (SageDataObjects50.ISDORecord)IWS.CreateObject("SalesRecord");&lt;br /&gt;&lt;br /&gt;// ISDORecord is too generic, use CoerceObject to perform a 'dirty' cast.&lt;br /&gt;ISR = (SageDataObjects50.ISalesRecord)ISDOR.JComCoerceObjectToAnotherType(SageDataObjects50.ISalesRecord.class);&lt;br /&gt;&lt;br /&gt;System.out.println("Customers:");&lt;br /&gt;while(true)&lt;br /&gt;{&lt;br /&gt;// Get the Acount_Ref field fr the customer&lt;br /&gt;JComVariant jcvAccountRef = new JComVariant("Account_Ref");&lt;br /&gt;SageDataObjects50.IFields ifsCustomer = ISR.getFields().getIFields();&lt;br /&gt;SageDataObjects50.IField ifCustomer = ifsCustomer.Item(jcvAccountRef).getIField();&lt;br /&gt;String strCustomer = ifCustomer.get_Value().getString();&lt;br /&gt;&lt;br /&gt;// Output the Customers' Reference&lt;br /&gt;System.out.println(strCustomer);&lt;br /&gt;&lt;br /&gt;// Move to the next Customer&lt;br /&gt;ISR.MoveNext();&lt;br /&gt;&lt;br /&gt;// If end of customers, break out.&lt;br /&gt;if (ISR.IsEOF()) break;&lt;br /&gt;}&lt;br /&gt;// Disconnect from Sage&lt;br /&gt;IWS.Disconnect();&lt;br /&gt;}&lt;br /&gt;catch(ezjcom.JComException eException)&lt;br /&gt;{&lt;br /&gt;System.out.println("Exception:" + eException.toString());&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;} &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;Licensing&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;/span&gt;&lt;br /&gt;Code written using the SageDataObjects library is subject to a 14 day trial license, and will cease to operate after those 14 days.  More details on this can be read at &lt;a href="http://www.sagedataobjects.com/"&gt;www.sagedataobjects.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The Java-Com bridge is subject to a seperate license, which can be obtained at &lt;a href="http://www.ezjcom.com/"&gt;www.ezjcom.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-6116088535262647378?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/6116088535262647378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=6116088535262647378' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/6116088535262647378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/6116088535262647378'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/04/connecting-sage-with-java.html' title='Connecting Sage with JAVA'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6281645949032982951.post-5982163878694242925</id><published>2008-04-17T12:34:00.000-07:00</published><updated>2008-09-04T15:57:07.130-07:00</updated><title type='text'>Sage on your website</title><content type='html'>&lt;span style=";font-family:arial;font-size:180%;"  &gt;&lt;br /&gt;Connecting Sage with your website&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Sage Data Objects can run within an ASP.NET web page, which will allow Internet visitors interact with your Sage accountancy software.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;Sage requires high levels of permissions to run from a ASP.NET website, which may lead to some security implications. Your web-server should be dedicated, and you will need either physical or remote desktop access to it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Configuring the Administrator Account&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;If your Administrator account has a blank password – that is, you are not asked to enter one, when logging onto the machine. Then you will need to configure the account to allow log-ons from non console applications.&lt;br /&gt;&lt;br /&gt;Press Start &gt; Run &gt; gpedit.msc&lt;br /&gt;&lt;br /&gt;Press Computer Configuration &gt; Windows Settings &gt; Security Settings &gt; Local Policies &gt; Security Options&lt;br /&gt;&lt;br /&gt;Click on “Account: Limit local account use of blank password to console log on only”&lt;br /&gt;Select Disable&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Configuring IISAdmin Service&lt;br /&gt;&lt;/span&gt;IIS will need to be able to interact with the desktop, in order to process Sage instructions. This is achieved thus:&lt;br /&gt;&lt;br /&gt;Press Start &gt; Control Panel &gt; Administrative Tools &gt; Services&lt;br /&gt;Right Click on IISAdmin, Select properties&lt;br /&gt;&lt;br /&gt;Press Log on&lt;br /&gt;Check “Allow service interact with desktop”&lt;br /&gt;&lt;br /&gt;Restart the service&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Configuring Machine.config&lt;br /&gt;&lt;/span&gt;The ASP.NET worker process (aspnet_wp.exe) will have to run under the Administrator account also, to configure this, you will need to edit the machine.config file&lt;br /&gt;&lt;br /&gt;Open C:\windows\Microsoft.net\Framework\v1.1.4322\Config\Machine.config in notepad&lt;br /&gt;&lt;br /&gt;Edit the ProcessModel section to add the following&lt;br /&gt;username=”Administrator”&lt;br /&gt;password=””&lt;br /&gt;Then Restart IIS.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Creating a Web Project&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Create a new Visual Basic .NET web application project in Visual Studio,&lt;br /&gt;Right Click on References &gt; Add Reference&lt;br /&gt;Select SageDataObjectComponent&lt;br /&gt;&lt;br /&gt;Add a Button to the page, named btnConnect, and a DataGrid named dgCustomers&lt;br /&gt;&lt;br /&gt;Click the button, and add this code:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;Dim sdo50 As SageDataObject50.SageDataObjects&lt;br /&gt;Dim ws50 As SageDataObject50.WorkSpace&lt;br /&gt;sdo50 = New SageDataObject50.SageDataObjects&lt;br /&gt;ws50 = sdo50.GetWorkSpace()&lt;br /&gt;Dim strACCData As String = ConfigurationSettings.AppSettings("ACCDATA")&lt;br /&gt;Dim strUsername As String = ConfigurationSettings.AppSettings("USERNAME")&lt;br /&gt;Dim strPassword As String = ConfigurationSettings.AppSettings("PASSWORD")&lt;br /&gt;ws50.Connect(strACCData, strUsername, strPassword, Guid.NewGuid().ToString())&lt;br /&gt;Dim alCustomers As ArrayList = New ArrayList&lt;br /&gt;Dim srCustomer50 As SageDataObject50.SalesRecord = _ DirectCast(ws50.CreateObject("SalesRecord"), SageDataObject50.SalesRecord)&lt;br /&gt;srCustomer50.MoveFirst()&lt;br /&gt;While True&lt;br /&gt;alCustomers.Add(srCustomer50.Fields.Item("Account_Ref").Value())&lt;br /&gt;srCustomer50.MoveNext()&lt;br /&gt;If srCustomer50.IsEOF() Then Exit While&lt;br /&gt;End While&lt;br /&gt;dgCustomers.DataSource = alCustomers&lt;br /&gt;dgCustomers.DataBind()&lt;br /&gt;ws50.Disconnect()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;Your Web.config will need the following values&lt;br /&gt;&lt;br /&gt;&amp;lt;appsettings&amp;gt;&lt;br /&gt;&amp;lt;add key="ACCDATA" value="C:\LINE50\ACCDATA\"&amp;gt;&amp;lt;/add&amp;gt;&lt;br /&gt;&amp;lt;add key="USERNAME" value="MANAGER"&amp;gt;&amp;lt;/add&amp;gt;&lt;br /&gt;&amp;lt;add key="PASSWORD" value=""&amp;gt;&amp;lt;/add&amp;gt;&lt;br /&gt;&amp;lt;/appsettings&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6281645949032982951-5982163878694242925?l=sagedataobjects.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sagedataobjects.blogspot.com/feeds/5982163878694242925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6281645949032982951&amp;postID=5982163878694242925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/5982163878694242925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6281645949032982951/posts/default/5982163878694242925'/><link rel='alternate' type='text/html' href='http://sagedataobjects.blogspot.com/2008/04/sage-on-your-website.html' title='Sage on your website'/><author><name>FreebieSMS</name><uri>http://www.blogger.com/profile/07993609941921275028</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00732345128817265549'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>