Link to home
Start Free TrialLog in
Avatar of edonasan
edonasan

asked on

Able to run my report

I have created some reports using Crystal Reports 8.
After i have changed my PC, and tried to run my reports again, i couldn't. It is the same version of Crystal Report which i'm using in my new PC.

I tried a very simple code:

Private Sub Command1_Click()
        Module1.connnectdb
        CrystalReport1.ReportFileName = "C:\temp\report1.rpt"
       
        CrystalReport1.SQLQuery = "select * from Table"
       
        CrystalReport1.Connect = rdconn
        CrystalReport1.Destination = crptToWindow
        CrystalReport1.WindowState = crptMaximized
        CrystalReport1.Action = 1
End Sub

the code will fail in my Action method.
my error msg is:
Run-time error '-2147417848 (80010108)'
Method 'Action' of object 'CrystalCtrl' failed

i have search the help file, it says that my database is not verified. but i have tried, it is verified and pointing to the correct database.

pls help.


Avatar of DRRYAN3
DRRYAN3

"I have changed my pc" - does this mean you have a new PC and have restored a backup to the new PC, or does it mean that you are using someone else's computer?

What is the error number and message being returned by the CrystalReport1 object (not the VB error)?

Can you access this table and db using a simple ADO recordset object?
Avatar of edonasan

ASKER

"i have changed my PC" - meaning i have a new machine now and restored the backup to the new PC.

this(VB error) is the only error number and message that i have. how do i generate the CrystalReport1 error from my VB program?

what is the another method on the ADO recordset object which u recommended? maybe i can try it out.

Thanks alot.
When you restored, did you reinstall Crystal Reports or try to run it from the restored copy?  You may have some DLLs which did not get registered.  Try reinstalling Crystal.

To catch the crystal error, try this type of thing

CrystalReport.PrintReport
If CrystalReport.LastErrorNumber <> 0 Then
  MsgBox "Crystal Reports Error Number " & CrystalReport.LastErrorNumber & vbCrLf & CrystalReport.LastErrorString, vbExclamation + vbOKOnly, "Crystal Reports Error"
End If

Try these two things to begin with:  Reinstall CRW, Add error catch.  I think reinstalling CRW will fix your problem.
i have tried re-installing Crystal Report.

I have got the same error.

Then, i tried to trap the crystal error,

Crystal last error number: 20520
Crystal last error string: Job already started

how can i resolve this?
That error message indicates that you have a report running at the point in time where you try to start another.  Is the code you provided the complete set of code you are running?

Try replacing the line
  CrystalReport1.Action = 1
with
  CrystalReport1.PrintReport

which is not supposed to generate the run-time error.
i am sure that there is no report running at the same time. yes, this is the complete set. It was working alright in my previous PC.

i have tried "CrystalReport1.PrintReport", it didn't work.
Let's see if we can isolate the problem to the CR Engine or the report.  Rename your existing report and create a simple report based on the same data set having the same name as the old report.  Do not include more that one or two fields on the new report.  Perhaps your report file is corrupt.  If the new, simple report doesn't run either, then the problem may be with the installation of the MDAC.
this example i gave is from the "new, simple" testing report which i tried creating to test out. it hit the same problem at the Action method.

so, if it's the problem with the installation of MDAC, how shd i fix it?

MDAC is from Microsoft and can be downloaded from http://www.microsoft.com/data.

Before you do that, what is the database you are using?  Could you post the module1.connectdb code you are using?

Are you using TTX files for your report?  Have you performed a Verify Database in Crystal Reports?
What is the scope of the variable rdConn?  Is it declared as public in one of your modules, or is it private?
I'm using a SQL Server 2000 database.

I have perform "Verify Database" in my Crystal Reports. It returns me "Database is up-to-date"

this is my module1:

Public rdconn As Connection

Public Static Sub connnectdb()
'Dim dbs As Database

 Set rdconn = New ADODB.Connection
 With rdconn
   .Provider = "SQLOLEDB"
   .ConnectionString = "SERVER=(local);" & _
                       "initial catalog=Test;" & _
                       "User ID =sa"
   .Open
   .CursorLocation = adUseClient
  End With
End Sub
Did you design your report using a TTX (Data Definition File)?  If so, check that Database->Verify on every print is NOT checked.

verified, the function is not checked.
So your report is based on a data definition (TTX) file?
I don't think so.
Dumb question, but do you know for sure that your database is working?  Can you preview these reports in the CRW designer?
yes, my DB is working alright. i can preview at my CRW designer.

I think the problem is with my VB. something is missing somewhere which caused the link to the report failed.

i have read alot of articles on MSDN and Crystal Report help. But none of them helps.

sigh...
when i used CrystalReport1.PrintReport then error msg becomes:

Run-time error '-2147417848 (80010108)'
Method 'PrintReport' of object 'CrystalCtrl' failed

it seems that it's the crystal report control is failing VB.
Going all the way back to the beginning of this thread, did you ever reinstall VB and the service packs after you restored?  Did you install CRW before or after reinstalling VB?
1st time, i think i installed CRW 1st.
then, my VB.

after i cannot run my report, i re-install my CRW (as it involves licensing, i did a reinstall, did not remove totally and install again)

then i thought it might be VB problem, i re-install my VB again (using the REPAIR function)

again, nothing helps.

today, removed my VB totally and install again (with SP5).
then, i re-install my CRW again. (3rd time...)

i'm getting quite tired of this already :(



i have called up Seagate Crystal Report support.
They confirmed that there is no particular sequence whether u shd installed either one first.

i'm going to try my last attempt to un-install CRW and install again.
re-installing of CRW does not help at all.

i think the probelm is not with CRW.

i did a testing by creating a report without any connection to my SQL database, which is a pure text report. it works perfectly alright with the statement "CrystalReport1.Action = 1", showing my report view.

so, i went to check my ado/odbc connection everywhere, it is working alright.

but it just won't work when it's connecting to my SQL.


Are you running NT or W2K?  If so, can you connect while logged in as an administrator?
i'm running on W2K. i have tried logging in as administrator. still did not work.

suspect the DLL problem, still checking.
There is a tech note at Crystal Decisions that applies to permissions on ODBC connections being trashed by CR8 installation.  I'll try to find it.
Any luck yet?  Here is a list of the DLLS with sizes and dates in my c:\windows\crystal directory.

P2BBDE   DLL       141,312  12-07-99  7:31a p2bbde.dll
P2BXBSE  DLL       212,992  12-07-99  7:31a p2bxbse.dll
P2SFS    DLL        77,824  01-06-00  7:15a p2sfs.dll
P2SOUTLK DLL       753,664  12-15-99  7:17a p2soutlk.dll
U2DAPP   DLL        28,672  12-07-99  7:31a u2dapp.dll
U2DDISK  DLL        28,672  12-07-99  7:31a u2ddisk.dll
U2DMAPI  DLL        40,960  12-07-99  7:31a u2dmapi.dll
U2DNOTES DLL        53,248  01-12-00  7:18a u2dnotes.dll
U2DPOST  DLL        49,152  12-07-99  7:31a u2dpost.dll
U2DVIM   DLL        57,344  12-07-99  7:31a u2dvim.dll
U2FCR    DLL        28,672  12-07-99  7:31a u2fcr.dll
U2FDIF   DLL        36,864  12-07-99  7:31a u2fdif.dll
U2FHTML  DLL        32,768  01-06-00  7:15a u2fhtml.dll
U2FODBC  DLL        49,152  12-07-99  7:31a u2fodbc.dll
U2FRDEF  DLL        65,536  12-07-99  7:31a u2frdef.dll
U2FREC   DLL        36,864  12-07-99  7:31a u2frec.dll
U2FRTF   DLL       122,880  01-26-00  7:39a u2frtf.dll
U2FSEPV  DLL        36,864  12-07-99  7:31a u2fsepv.dll
U2FTEXT  DLL        81,920  12-07-99  7:31a u2ftext.dll
U2FWKS   DLL        40,960  12-07-99  7:31a u2fwks.dll
U2FWORDW DLL       106,496  12-07-99  7:31a u2fwordw.dll
U2FXLS   DLL       208,896  01-26-00  7:39a u2fxls.dll
CRXLAT32 DLL        24,576  12-07-99  7:31a Crxlat32.dll
P2SSQL   DLL       163,904  01-06-00  7:15a p2ssql.dll
P2LSQL   DLL        94,208  10-27-99  8:55a P2lsql.dll
P2BBTRV  DLL        77,824  12-07-99  7:31a p2bbtrv.dll
P2CTBTRV DLL        53,248  01-28-00 12:49p p2ctbtrv.dll
P2IXBSE  DLL       229,376  11-17-99  4:47p p2ixbse.dll
P2LODBC  DLL       122,880  09-29-99 10:14a p2lodbc.dll
P2MOLAP  DLL       270,336  01-07-00  8:15a p2molap.dll
P2SOLAP  DLL       258,048  01-07-00  8:15a p2solap.dll
P2SMSIIS DLL       164,864  12-10-99  7:17a p2smsiis.dll
P2SWBLG  DLL       137,728  12-10-99  7:17a p2swblg.dll
P2SOLEDB DLL       196,608  01-06-00  7:15a p2soledb.dll
U252000  DLL        24,576  12-07-99  7:31a u252000.dll
U25DTS   DLL        24,576  12-07-99  7:31a u25dts.dll
U2L2000  DLL        24,576  12-07-99  7:31a u2l2000.dll
U2LCOM   DLL        45,056  12-07-99  7:31a u2lcom.dll
U2LDTS   DLL        24,576  12-07-99  7:31a u2ldts.dll
U2LEXCH  DLL        28,672  12-07-99  7:31a u2lexch.dll
U2LFINRA DLL        49,152  12-07-99  7:31a u2lfinra.dll
U2LSAMP1 DLL        24,576  12-07-99  7:31a u2lsamp1.dll
U2L_FSC  DLL        73,728  12-20-00 12:37a U2l_fsc.dll
Hi,

checked the article u helped me to find, followed the instructions stated, but still the same.

checked most of the DLLs in ur list, they are similar.
still having the same problem.
Edonasan

I suggest that you try to pinpoint the problem by creating a simple report that you can call from VB.  Do not base it off your SQL server.  Use an Access file (some example files come with CRW if you don't have Access).  If you can call the report, preview it and print it then I think we can rule out both Visual Basic and the Crystal Engine.

Assuming that works, then I suggest an ODBC version of a report accessing your SQL server instead of the native drivers.  If that works, then the problem has been pinpointed to the native SQL drivers that CRW uses.

If it doesn't work (the access report), then your problem lies in the integration of VB and CRW and is not initially a SQL server problem.

You might also try both the CRAXDRT and CRPEAUTO library methods of calling a report from VB.  Perhaps one of them is not installed properly.

Finally, please verify that you have either the Professional or Enterprise version of CRW installed by checking Help->About in Crystal.  Perhaps you have used the wrong activation code (a long shot, but you never know).

I will be gone for 10 days starting later today.  Don't think I'm ignoring your comments, but I am not taking a PC on vacation.

Best of luck
Hi DRRYAN3!

my problem is solved.

the reason being is that I have installed the new Visual Studio .NET in my PC previously. although i have removed thoroughly and installed back my old Visual Studio 6, the DLLs remained the later version by VS.NET, which the newer version does not support crystal report, as it is extremely BETA. the main DLL which is causing my problem is CRPE32.DLL. after replacing it with the earlier version, my report is working alright.

thanks to the help of the Crystal Report Support Team.

Also, i like to thank you, DRRYAN3, too...for all the advice u have gave me throughout the debugging phase.

Hope u enjoy your vacation!
edonasan

Glad you got your problem fixed.  You never mentioned installing VS.NET, but that happens.

If you want to close this question without awarding points, leave a note in community support asking them to PAQ this question, otherwise, you can accept any of my comments as an answer.

PS - I did enjoy my vacation ... never saw a PC!

DRRYAN3
edonasan

Have you abandoned this question?
edonasan

Please resolve this open question.  I spent a lot of time trying to help you through your problem - At the least you could close it by accepting an answer or asking CS to PAQ the question or reduce the points.

DRRYAN3
ASKER CERTIFIED SOLUTION
Avatar of DRRYAN3
DRRYAN3

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial