It sounds like wwDotNetBridge is doing it's job. I can't speak to Sage but that you have to take up with them.
If you're getting a result back or there is no error message (ALWAYS check cErrorMsg or the result value after calls) then wwDotNetBridge calls are going through. Errors don't throw when you call InvokeMethod, so if something goes wrong you have to check the return value of the method (if that indicates failure) or check cErrroMsg.
since there are no specific parameters or return values (?) that are problematic for FoxPro. If you call it this way any error will throw a FoxPro error that you can check.
Hi
I'm trying to use wwDotNetBridge to interface with Sage 200 accounts (.net 3.5). I'm failing at almost the first hurdle - logging on to Sage 200.
Having loaded the relevant Sage 200 assemblies, I then do this:
LOCAL oApplication As Sage.Accounting.Application
cName = 'TEST2'
cPass = 'test2'
oApplication = oBridge.CreateInstance('Sage.Accounting.Application')
oBridge.InvokeMethod(oApplication, 'Connect', cName, cPass)
... which follows this VB.Net code example:
Dim application As Sage.Accounting.Application = Nothing
application = New Sage.Accounting.Application
application.Connect("John", "orange")
Superficially this works (ie no error thrown) and if I open the Sage 200 Admin Console TEST2 is shown as an active user. However, the logon has in fact failed. When I dig around, I find that Sage.MMS.SAA.Client.ConnectionState returns 0 (not logged on) and the message 'Unable to authenticate user'.
Sage support has this to say:
As you’re not getting any error back when you call Connect, I assume that the username and password are correct.
- Are you able to log into the client UI with those details?
- Are you running your code on a web service / web site or via a WPF application?
- Are you running our connection and activecompany code across different threads?
.. to which the answer is yes, no, no.
Can anyone shed any light on why this is failing?
Thanks