|
CRM Software - CABC | Maximizer | Maximizer Add-ons | Services | Support | Store | News |
![]() |
![]() |
|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
| Member |
Is anyone out there using MaAccess COM objects with Visual FoxPro? If so, I'd like to ask about an instantiation issue with
MaHost.
|
||
|
| Member |
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. |
|||
|
| Master |
Try
o = CreateObject("MaAccess.Host") |
|||
|
| Member |
Nope, that gives the same message.
|
|||
|
| Master |
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 = NothingIf the Visual FoxPro equivalent doesn't work for you then it must be a VFP thing. |
|||
|
| Member |
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. |
|||
|
| Powered by Social Strata |
| Please Wait. Your request is being processed... |
|
|
CRM Software - CABC | Maximizer | Maximizer Add-ons | Services | Support | Store | News |

