PDA

View Full Version : Solved: ACCESSW.EXE



philfer
04-23-2008, 05:36 AM
Hello,

Does anyone know what the above could relate to. It isnt a normal access reference is it?

I am seeing it in some code where an object is created as myobj and then the code says:-

With my obj
.Logon ("C:\ACCESSW\ACCESSW.EXE HOST.ACW")

Can anyone shine any light on what this is doing or at least point me in the right direction

Thanks
Phil

Oorang
04-23-2008, 06:11 AM
Post the whole procedure. It's tough to say without context.

philfer
04-23-2008, 06:16 AM
Basically it seems to open our accounting system and post an entry to it.

it starts off with :-

myobj = CreateObject("PHILFER.UMAS")

Then goes :-

With myobj
.Logon ("C:\ACCESSW\ACCESSW.EXE HOST.ACW")

Then has other field entries (I am doing this bit by memory as I dont have the code with me) :-

.fundnumber = Sheets("Sheet1").Range("A5").Value
.post

Then it logs off.

I would really like to understand the CreateObject bit and the ACCESSW bit, even if you know any sources of information or books that would help me with this.

Thanks for your input so far

Oorang
04-23-2008, 06:52 AM
Ok well a little background so you know where I am heading. "CreateObject" creates an Automation object. Which is to say someone, somewhere created a program using COM (http://en.wikipedia.org/wiki/Component_Object_Model). This exposes the program to being controled by other programs. When you use CreateObject you are grabbing an instance of that program (or the parts that have been exposed). The methods and properties available to you are dependant on what the developer choose to expose.

So when you do myobj = CreateObject("PHILFER.UMAS") You are creating a PHILFER.UMAS.

Okay, so how to tell what that is? Well COM objects are registered under HKEY_CLASSES_ROOT\CLSID. You will see a bunch of GUID (http://en.wikipedia.org/wiki/GUID)s listed. Do a find for "UMAS". Obviously I do not know what it's GUID will be so I will use {00000000-0000-0000-0000-000000000000} for this example. You should find an entry in HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000000}\ProgID
That has a value of either "UMAS" or "PHILFER.UMAS". In the same GUID (again we will use or pretend GUID) there should be a key called HKEY_CLASSES_ROOT\CLSID\{00000000-0000-0000-0000-000000000000}\InprocServer32. That key's value should be the name of the object you are using when you do CreateObject("PHILFER.UMAS").

Ok so all of that just got us to the point where we know what obj is. But what you really wanted to know was what is " .Logon ("C:\ACCESSW\ACCESSW.EXE HOST.ACW")" all about. To know that you need know what the logon method is doing with that string. The first obvious thing to do is check the documentation. Once you know what file PHILFER.UMAS is, you will want to do a little research and see if there is any accompanying documentation or help files. Most COM exposed programs publish a programming guide. Short of that, SOME will expose themselves in such a way that you can set a reference to them vie the Visual Basic Editor. This will allow you to see the whole object model via the object browser.

Hope that gets you started!

philfer
04-26-2008, 12:10 PM
Thanks for that.

How does one learn things like this. In the VBA, Access or Excel books you wouldnt find information or answers like this.

Are there any books you could recommend that cover topics such as these.

Or do I have to do a computer science degree!!!

Oorang
04-26-2008, 09:18 PM
lol A lot of that you wouldn't have picked up unless you learned COM & ActiveX which are technologies you don't get your hands dirty with unless you dig into C++ or VB (not vba mind you, vb).

But other than that, you are already doing it. When you get curious, research, and ask:)