Archive

Archive for July, 2005

Connection string for Sage ODBC via OLEDB

July 26, 2005 5 comments
Provider=MSDASQL.1;Persist Security Info=False;User ID=Manager;Data Source=SageLine50v9;Extended Properties="DSN=SageLine50v9;UID="
 
When Sage Line 50 is installed, it creates a system ODBC DSN called SageLine50v9 (I assume other versions of sage have corresponding names). The "database "contains the following tables:
 
TABLES
COMPANY
PERIOD
SALES_LEDGER
PURCHASE_LEDGER
NOMINAL_LEDGER
AUDIT_HEADER
AUDIT_SPLIT
AUDIT_JOURNAL
AUDIT_VAT
AUDIT_USAGE
DEPARTMENT
BANK
STOCK
STOCK_TRAN
STOCK_CAT
STOCK_COMP
INVOICE
SALES_ORDER
PURCHASE_ORDER
RECURRING
FIXED_ASSET
FIXED_ASSET_CAT
PREPAYMENT
ACCRUAL
INVOICE_ITEM
SOP_ITEM
POP_ITEM
SALES_CONTACT
PURCHASE_CONTACT
SALES_DEL_ADDR
PURCHASE_DEL_ADDR
COMPANY_DEL_ADDR
PRICE
PRICE_LIST
GRN_ITEM
CHART_LIST
CAT_TITLE
CATEGORY
TAX_CODE
UPDATE_LEDGER
CURRENCY
VAT_SUMMARY
VAT_RETURN
REMITTANCE
Advertisements
Categories: Uncategorized

Bad page viewstate in asp.net

July 25, 2005 Leave a comment
Everybody who has worked with ASP.NET will be aware of the page viewstate. .NET’s way of persisting session information using hidden values on the page. However, you may find that if you accidentally post a viewstate from one page to another, or for some reason the worker process looses track of the page viewstate (such as within a server farm, or, as I suspect, where multiple worker processes are handling the same client) – you get an error such as the following:
 
[HttpException (0x80004005): Unable to validate data.]
   System.Web.Configuration.MachineKey.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +195
   System.Web.UI.LosFormatter.Deserialize(String input) +60
[HttpException (0x80004005): Authentication of viewstate failed.  1) If this is a cluster, edit <machineKey> configuration so all servers use the same validationKey and validation algorithm.  AutoGenerate cannot be used in a cluster.  2) Viewstate can only be posted back to the same page.  3) The viewstate for this page might be corrupted.]
   System.Web.UI.LosFormatter.Deserialize(String input) +118
   System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +101
[HttpException (0x80004005): Invalid_Viewstate
 
You can of course, use persistant storage, such as SQL server to store the viewstate, but if it is just a rare occurance, you can have the page handle the event gracefully as follows
 

protected override object LoadPageStateFromPersistenceMedium()

{

object pageState;

try

{

pageState = base.LoadPageStateFromPersistenceMedium();

}

catch

{

// Something has gone wrong, reload page back to a stable state.

pageState = null;

Response.Redirect(Request.RawUrl);

}

return pageState;

}

 
That is, if the viewstate’s bad. then reload the page without any post data.
 
You can also return null from this procedure without redirecting, but this may have some unusual side effects.
Categories: Uncategorized

Google Maps API

July 23, 2005 Leave a comment
After being quite amazed at Google earth, I had a look to see if there was an API available. The closest I can find is Google maps API (http://www.globefinder.info/googleMapAPI.html) – Although, an excellent web-based map, it doesn’t show terrain, or show houses and buildings like the Google Earth App.
 
Pity.
Categories: Uncategorized

Nokia 3210 opening instructions

July 22, 2005 Leave a comment

Nokia 3210 opening instructions:

(1) Scrabble at case with fingernails, break 3 fingernails in process.

(2) wedge knife down side of case, twist until knife buckles

(3) push cover against door and wedge 2p into plastic cover.

(4) Try to retrieve 2p with buckled knife

(5) cover should snap violently open, with battery thrown accross room.

 

 

 

Categories: Uncategorized

Iterating products from sage

July 22, 2005 Leave a comment
I was working on a bit of code to iterate through all products stored within sage, eventually found it (code in VB.NET)
 

Dim SDO As New SageDataObject90.SDOEngine

Dim wsStock As SageDataObject90.WorkSpace

Dim srStock As SageDataObject90.StockRecord

Dim i As Short

Dim strDescription As String

Dim strStockCode As String

wsStock = SDO.Workspaces.Add("Myconnection")

wsStock.Connect(SageLocation, SageUsername, SagePassword, "ThisIsUnique")

srStock = wsStock.CreateObject("StockRecord")

srStock.MoveFirst()

Do

strDescription = srStock.Fields.Item("DESCRIPTION").Value

strStockCode = srStock.Fields.Item("STOCK_CODE").Value

srStock.MoveNext()

Loop Until srStock.IsEOF

wsStock.Disconnect()

Categories: Uncategorized

Sage data objects

July 15, 2005 Leave a comment
For anybody developing software to integrate with sage, here’s a tip which will save the £1,500 enrollment fee in the sage developer program. You can download the Sage data objects from http://www.eosuk.com/downloads/downloadsuk.htm
 
If you copy the relevant TLB (type library files) into Windows/system32 on a machine that previously had Sage installed (i.e. SDOENG90.dll is in the system folder) you can then make a COM reference to the type library. And for those .NETter’s out there, i’m sure you can create the wrapper class from that.
 
 
Categories: Uncategorized

C# Library for ZIM

July 13, 2005 Leave a comment
Just finished developing a C# Library for te ZIM platform.  used VSHIK and NDOC to document the class, and it looks quite well, apart from some classes that are really for internal use only appearing in the documentation… I guess they’re supposed to be "Sealed" or something.
 
 
 
Categories: Uncategorized