In the Session.Init method, I'm getting an error that just shows 1.4197.5
I have no idea what this means and don't see documentation anywhere that explains it. Can anyone help on what this means?
Is regular Sage installed and running on your PC?
I have Sage 300 erp installed in trial for 30 days
I don't know. Make sure that Sage and Visual Studio are running at the same security level, i.e., if one of them is "as administrator", then they both need to be.
Was able to track this down in the event logs
Error: 50000 Severity: 20 State: 1 SAGE ERROR 50004: The application 'SQLServerCEIP' is not allowed to connect to this server
But my Sage 300 app is working just fine, so not sure why the API is getting this error
Which version of Sage are you using? 62A is Sage 2014.
The code to create a session using .NET is:
DBLink mDBLinkCmpRW; Session accpacSession = new Session(); accpacSession.Init("", "XY", "XY1000", "66A"); // 66 is 2019 accpacSession.Open("ADMIN", "ADMIN", "SAMLTD", DAteTime.Now, 0); mDBLinkCmpRW = accpacSession.OpenDBLink(DBLinkType.Company, DBLinkFlags.ReadWrite);
Excellent, that worked. Wow, the error messages with this are almost useless haha. So, how did you know 66a is the right code? I'm having a very difficult time finding any good documentation on this
There is no good documentation besides Google searches.
If you are a dev partner there is more documentation, you can also try the Sage NA GitHub, https://github.com/SageNADev. With the SDK there is documentation and samples. It isn't the most comprehensive but...otherwise, like Jay said, Google searches is your friend.
Sage release numbers are:
2010: 60
2012: 61
2014: 62
2016: 63
2017: 64
2018: 65
2019: 66
2020: 67
2021: 68
2022: 69
I think the idea is that going forward Sage will be known by its release year but internally the version number is still used in places. For documentation, there is the github which gives you info about the web API. There is here and a couple of other forums Tek-Tips and PlusCommunity. You get the odd question on Stack Overflow and Experts-Exchange. There is no real documentation out there for developing with Sage 300. Usually someone shows you and you pick up from other code and by asking questions. Most of the time, to get an idea of how to do something, record a macro. That will give you the rough structure and from that you can convert to C# quite easily but there are online tools to help although I haven't used them. For COM API I found this. There is the DPP wiki but you will need to be a DPP Partner to access that. There is always Steve Smiths blog for lots of snippets. Other than that you might find the odd page here and there. These forums are the most active though.
*Community Hub is the new name for Sage City