AyaNova service management & work order software
AyaNova Support Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Microsoft Access / COM / API etc Expand / Collapse
Author
Message
Posted 6/20/2008 11:26:58 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/6/2008 3:28:23 PM
Posts: 4, Visits: 11
I am trying to build a tool in MS Access to work with Ayanova and I am trying to authenticate to Ayanova so we don't have to store 2 sets of credentials, but the API is .net only and I can't use the functions from Access.
Are there any plans to build a set of API tools to work with Access/VB?

Thanks

Post #4116
Posted 6/20/2008 12:07:01 PM
AyaNova Development & Support

AyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & Support

Group: Administrators
Last Login: 10/8/2008 11:18:40 PM
Posts: 100, Visits: 420
Hi, the AyaNova developers API is written in managed .net.

VBA for office apps such as Access and classic VB6 can not work directly with managed objects, however they can work with COM objects because they are all COM clients and a COM client can access a .net assembly indirectly through a Com Callable Wrapper. 

Note that we have not tested this with AyaNova you will be pioneering in theory it should work but I just don't know.

There are many sources of info online about creating interop type libraries from .net assemblies, this one seems pretty good:

http://www.blong.com/Conferences/BorConUK2002/Interop2/COMNetInterop.htm#CCW

If this works note that there are down sides to using this method: performance will take a hit due to marshalling necessary, you won't get intellisense help in Access such as you would get if using a managed environment like VB.NET because AyaNova methods are not marked internally with the attribute necessary to support early bound interfaces and any app you create would require registering the type library on the end users computer to stuff the registry with the necessary settings so deployment would be far more complex than with a managed application created in a .net development environment.

In other words if you have any choice at all on what development tool to use I *highly* recommend you use a managed development environment such as VB.NET instead (if you are already familiary with VB, there are plenty of other choices as well) as you can then just work directly with the AyaNova developers API and get the full intellisense assistance, as well deployment is as simple as dropping your executable in the AyaNova program folder etc and we would be able to give you far better support here since that's an environment it's designed to work in. 

Visual studio 2008 Express edition is free and available here: http://www.microsoft.com/express/default.aspx

Post #4117
Posted 6/24/2008 8:27:32 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/6/2008 3:28:23 PM
Posts: 4, Visits: 11
Thanks for your reply,

I downloaded the latest version of API from your web site and none of the assemblies are included (GZTW*.dll).

I have old Ayanova 3.1 dlls and they don't seem to work with Ayanova 4.

Do you have a new version of these files and will they be available for download?

Thanks,

Alex

Post #4128
Posted 6/24/2008 9:25:20 AM
AyaNova Development & Support

AyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & Support

Group: Administrators
Last Login: 10/8/2008 11:18:40 PM
Posts: 100, Visits: 420
amilojko (6/24/2008)
Thanks for your reply,

I downloaded the latest version of API from your web site and none of the assemblies are included (GZTW*.dll).

I have old Ayanova 3.1 dlls and they don't seem to work with Ayanova 4.

Do you have a new version of these files and will they be available for download?

Thanks,

Alex

Hi Alex, the assemblies never need to be included because you use the api files that come freely with AyaNova already installed, the api you download from us isn't an api, it's documentation and sample projects, you already have the api when you install AyaNova.  

AyaNova the program and it's add-on's use the *exact same api* that you would use for development, it's right there in the program folder.  You don't even need to buy AyaNova to develop for it because the trial comes with the *exact same api files*.

3.1 is pretty old but there's no reason you can't use it for development though I highly recommend you upgrade to the latest AyaNova because all the documentation for the API, the sample projects etc are all for v4.x and v4 is a significant change and improvement from the old 3.x era stuff.

Post #4130
Posted 6/24/2008 5:09:19 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/6/2008 3:28:23 PM
Posts: 4, Visits: 11
Right,

thanks I didn't even think to look into Program files for those dlls.

Cheers

Post #4131
Posted 6/24/2008 6:00:31 PM
AyaNova Development & Support

AyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & Support

Group: Administrators
Last Login: 10/8/2008 11:18:40 PM
Posts: 100, Visits: 420
amilojko (6/24/2008)
Right,

thanks I didn't even think to look into Program files for those dlls.

Cheers

The documentation would have been a great place to start!

Cheers!

Post #4132
Posted 7/15/2008 2:57:34 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/16/2008 4:51:36 PM
Posts: 2, Visits: 5
Hi guys. I was contracted to work on exactly this same issue - making Ayanova API accessible from Visual Basic in Access. I managed to put together a .NET wrapper project (very simple at the moment), register it using the regasm utility, and access the API functions from Access. One odd thing I ran into - when I check the AyaBizUtils.ExpiryDate property right after running AyaBizUtils.Initialize(), it always shows the current time and date. So no matter what, the Expired property is always true, and the DB is read-only. Any idea why this may be? It only seems to happen when I run Initialize in a method exposed to COM. I worked through the CSHelloAyaNova sample in .NET with no problem at all.

I can provide examples of what I did if anyone is interested. Thanks a lot for any feedback.
Post #4194
Posted 7/15/2008 3:21:40 PM
AyaNova Development & Support

AyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & SupportAyaNova Development & Support

Group: Administrators
Last Login: 10/8/2008 11:18:40 PM
Posts: 100, Visits: 420
zammer (7/15/2008)
Hi guys. I was contracted to work on exactly this same issue - making Ayanova API accessible from Visual Basic in Access. I managed to put together a .NET wrapper project (very simple at the moment), register it using the regasm utility, and access the API functions from Access. One odd thing I ran into - when I check the AyaBizUtils.ExpiryDate property right after running AyaBizUtils.Initialize(), it always shows the current time and date. So no matter what, the Expired property is always true, and the DB is read-only. Any idea why this may be? It only seems to happen when I run Initialize in a method exposed to COM. I worked through the CSHelloAyaNova sample in .NET with no problem at all.

I can provide examples of what I did if anyone is interested. Thanks a lot for any feedback.

Hi Zammer, interesting.  I'm glad to hear you got a wrapper working (at least basically), I was pretty curious about it myself.

I'm sure you have already but double check the really obvious stuff like the config.txt file, make sure you can connect and login to the exact same database using the same config.txt file with the windows app AyaNova.exe etc etc.

The Expired property can return true under a couple of conditions:

  • If you are using a biz object .dll for version 4 but have a v3 license in the database.
  • If it's a trial license key and passed the 30 day trial or whatever date was set by us if it was a licensed trial

The ExpiryDate property should only be returning an actual date if it's a time limited license key like a trial or DateTime.MaxValue if it's not.

Returning current date and time sounds as though it's not intializing properly as that would be a default value it's initialized to before any processing takes place.

Try the static AyaBizUtils.View() method which returns a string, it should show you all the info about the license whether it's a trial or not just after you make the call to Initialize().  If the View method returns "Invalid Data" then it's somehow not really initializing properly.

I'm sure many people would like to see the examples of what you did feel free to post them here in this or another thread.  Let me know what you see with the above info I've provided.  I'd like to find out definitively if this will work or not from COM and if any changes are required at our end to get it working if that's required and possible.

Cheers!

Post #4195
Posted 7/16/2008 5:06:49 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie
<