CRM Software - CABC | Maximizer | Maximizer Add-ons | Services | Support | Store | News

    Buy Maximizer Products and Services On-Line at CRMshop.co.uk
CABC    Maxtalk  Hop To Forum Categories  Maximizer CRM Software  Hop To Forums  Maximizer Support    Using MaAccess COM object with Visual FoxPro
Go
New
Find
Notify
Tools
Reply
  
Using MaAccess COM object with Visual FoxPro
 Login/Join
 
Member
Posted
Is anyone out there using MaAccess COM objects with Visual FoxPro? If so, I'd like to ask about an instantiation issue with MaHost.
 
Posts: 5 | Registered: September 15, 2005Reply With QuoteReport This Post
Member
Posted Hide Post
Additional Info: I can use the object browser in FoxPro to view the classes and methods, but I can't seem to create the object. The commands I've been trying all get the same error message [Class definition is not found] see below.

o = CreateObject("MaHost")
o = CreateObject("MaAccessLib.MaHost")
o = CreateObject("MaAccessLib")


My hope is that this is a simple issue where there is some step required by FoxPro that isn't listed in the Visual Basic example in the Integrator's Toolkit reference. Any assistance anyone can provide would be most appreciated.
 
Posts: 5 | Registered: September 15, 2005Reply With QuoteReport This Post
Master
Posted Hide Post
Try

o = CreateObject("MaAccess.Host")
 
Posts: 728 | Registered: July 14, 2000Reply With QuoteReport This Post
Member
Posted Hide Post
Nope, that gives the same message.
 
Posts: 5 | Registered: September 15, 2005Reply With QuoteReport This Post
Master
Posted Hide Post
The following VBScript works for me:

Option Explicit

Dim o, c, vLogin

Set o = CreateObject("MaAccess.Host")
o.Init "MaAccess Sample", "DSN=MAS_EsconaTutorial", 5, "", ""
If Not o.DBLoginCheck("", "JNAPOLI", "password", vLogin) Then
   Wscript.Echo "Login failed."
Else
   Set c = o.CreateObject("Company", vLogin)
   c.Clear
   c.SetLikeValue "Company_Name", "ABC%"
   If c.Select(1) Then
      Wscript.Echo c.Company_Name & " - " & c.Client_Id
   Else
      Wscript.Echo "No match."
   End If
   c.EndSelect
   Set c = Nothing
End If
Set o = Nothing

If the Visual FoxPro equivalent doesn't work for you then it must be a VFP thing.
 
Posts: 728 | Registered: July 14, 2000Reply With QuoteReport This Post
Member
Posted Hide Post
I finally got an answer that works, but it raises other questions. DC
----------------------
This is from an unnamed developer, passed on to me by my sale engineer.

From my understanding of how the createobject call works:

A1. It will look in the registry in the hkey classes root folder for the classid that is passed in.

A2. From there it will get the guid associated with the classid 3. The os will look for the guid and the dll associated to launch.

Either there is something corrupt in his registry such that it can't
locate the "MaAccess.Host" or there is something wrong with VFP. There are actually 2 options:

B1. Try "MaAccess.Host.1", this is the other registry key that will also locate the MaHost object. I know because IT uses that classid in some of our apps. If you look in the registry, both entries return the same guid.

B2. Ask them to create a text file and rename the extension to .vbs, then edit in notepad. Write 2 lines:
Dim o
Set o = CreateObject("MaAccess.Host.1") Close and save the file. Double click on the vbs file and if no error pops up then there is something wrong with VFP. But if an error occurs then something is wrong with the OS (possibly the registry) or something is wrong with ME install.
 
Posts: 5 | Registered: September 15, 2005Reply With QuoteReport This Post
  Powered by Social Strata  
 

CABC    Maxtalk  Hop To Forum Categories  Maximizer CRM Software  Hop To Forums  Maximizer Support    Using MaAccess COM object with Visual FoxPro

© CABC Ltd 2002 - 2010. All Rights Reserved.
Maximizer is a trademark of Maximizer Software inc.