Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

$64,000 Question: Why Does The OCX Stop Working (Part III) ??? 1

Status
Not open for further replies.

drosenkranz

Programmer
Sep 13, 2000
360
US
As you can see in the prior two postings, the Crystal OCX was not working. The issue has clarified itself to the point of one issue. Being a VB Programmer, I am unfamiliar with FoxPro's setup. Here's the question of the week;

Why does the Crystal Reports OCX only work with the project open in the FoxPro development window? If the application is compiled- all of the rerports using Crystal Report's OCX fail. If I run it from the development window, they run great. WHY??? [sig][/sig]
 
Few questions:

What version of VFP are you using?
What version of Crystal Reports are you using?
When you designed your reports, how did you connect to the data? Directly via Fox2 or ODBC-VFP?
After building your app, is the .exe ran from the same directory as the project?
Is the live report using the same data that the design report used?
Is the app being ran on the machine it was compiled on?

SWAG, but try issuing a SYS(2331,1) in the load event of your form that contains the crystal ocx.

FWIW, I've been told you are better off using the CRPE automation server than the Crystal ActiveX. [sig]<p>Jon Hawkins<br><a href=mailto: jonscott8@yahoo.com> jonscott8@yahoo.com</a><br><a href= > </a><br>Focus on the solution....Not the problem.[/sig]
 
VFP 6.0
Crystal Reports 7.0
ODBC-VFP
EXE runs from same directory- just reports no longer function
Same data sources
App's reports will not run after compiled on the development machine- reports only run from the project itself (with the project open).

Crystal Reports will fail to work except with the project open and &quot;DO Main_Prog&quot;
They also function from Crystal Reports manually.

Will try your sys(2331,1) suggestion- any other ideas on ODBC come to mind?
[sig][/sig]
 
&quot;OLE iDispatch exception code &quot;0&quot; from Crystal Reports. Cannot open SQL Server&quot;

About this error message, why is it trying to use the SQL Server ODBC driver instead of the VFP ODBC driver?

Do you have any information or ideas on why the Crystal OCX behaves so poorly with FoxPro 6.0 or how to fix it?

FWIW, a year ago I was involved in a project that integrated Crystal Reports with a VFP program. We originally used VFP-ODBC to connect to the data source when building the reports in Crystal Reports. What we found was that when we ran the report from within VFP, Crystal ALWAYS looked to the machine's VFP ODBC driver for the source path of the VFP tables. This is stored in the registry of the following key: HKEY_LOCAL_MACHINE\Software\ODBC\ODBCINST.INI\Microsoft Visual FoxPro Driver
The value is SourceDB.

We could programmatically set this keyvalue to the path of our VFP data, and the report would run fine.

An alternative to using ODBC in Crystal is to export your data to Fox2 format and then run the report off that data. Crystal recognizes Fox2 as native data and needs no ODBC connection. [sig]<p>Jon Hawkins<br><a href=mailto: jonscott8@yahoo.com> jonscott8@yahoo.com</a><br><a href= > </a><br>Focus on the solution....Not the problem.[/sig]
 
Jon,

Need to do some VB training and installations tomorrow. Need a break anyway from the frustration of having a &quot;finished&quot; application that I can't manage to install on another system.

I'll try some of your suggestions tomorrow or Wednesday. I really appreciate you taking the time to supply additional info on VFP/Crystal applications. It's really hard to come by. Thanks again for all your time and energy. God Bless.
[sig][/sig]
 
Hi David,

From email-
Where did you come up with SYS(2331), I can't find
documentation on it in any of my books?


Uhhh...Oops. I meant to say SYS(2333,1) to enable ActiveX dual interface support, not 2331.

Anyhow it worked- and I still can't believe it!

Wow. s-)

Just curious. But as a test, replace SYS(2331,1) with SYS(2333,1) and see if you get the same results. Maybe SYS(2331) is an undocumented feature, ya think??? LOL [sig]<p>Jon Hawkins<br><a href=mailto: jonscott8@yahoo.com> jonscott8@yahoo.com</a><br><a href= > </a><br>Focus on the solution....Not the problem.[/sig]
 

I was out of options last night so I figured I had nothing to lose so I put in the SYS(2331,1) and recompiled the project. It worked- and it was the only change I made.

Now the project that used to only be able to run Crystal Reports from the development window can now run Crystal from the EXE. Then a new problem!

When I created the installation diskettes and used them to install the software on another user's machine, the EXE now fails to run Crystal. Any ideas?

I downloaded mdac 2.5 on my machine earlier- do I have to run it on the user's machine too? Shouldn't the installation diskettes contain all of the ODBC file rqmts to update the user's machine automatically?

FYI: I'm going to try the SYS(2333,1) in place of the SYS(2331,1) and retry the installation anyway. This is getting really tedious- and frustrating- when the entire application has been finished for a week but I still can't install it.. [sig][/sig]
 
To clarify the current problem.

My new EXE can run Crystal Reports from the development machine. When I installed it on the user's machine with FoxPro's installation disks, the EXE can NOT run a crystal report. Any Ideas? [sig][/sig]
 
The user's machine can NOT run a report through the OCX in either the mainmenu.exe, the mainmenu.fxp, or the mainmenu.prg from the development window. The new error appears as follows:

OLE error code 0x800a5077 unknown COM status code.

I have mdac 2.5 on my machine now and the user still has 2.1.

When I originally tried the FoxPro installation diskettes, I thought they'd install any ODBC files and resolve this issue. Is FoxPro's Setup Wizard adequate? [sig]I can do all things through Christ who strengthens me.<br>
Favorite verses: Isaiah 53, Jeremiah 31:31-34, Psalm 16:10[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top