Crystal report - VB error

hasan_tek
hasan_tek used Ask the Experts™
on
Need help in crystal report-VB :
CrysRep.Action = 1

at this line I am getting the following error..
Error : 20536
description :Unable to connect: incorrect log on parameters.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Vitor MontalvãoIT Engineer
Distinguished Expert 2017

Commented:
Well, like the error description says, you passed incorrect parameters on connection.

For we can help you, pls paste here the part of your code where you pass the connection parameteres.
And we need to know what database are you using.

Here's a clue. The CR connect string is very similar that you probably are using to access data in your app.

Good luck,

Vitor Montalvao

Author

Commented:
I am using MS access and connecting thru
CrysRep.Connect = "DSN=c:\db1.mdb"
   CrysRep.CopiesToPrinter = 1
    CrysRep.MarginBottom = 0.05
    CrysRep.MarginLeft = 0.05
    CrysRep.MarginRight = 0.05
    CrysRep.MarginTop = 0.05
    CrysRep.ReportFileName = strAppPath & strReportName
    CrysRep.WindowState = crptMaximized



    CrysRep.WindowTitle = ReportTitle

    CrysRep.SelectionFormula = strSelectionFormula
CrysRep.Action = 1

Author

Commented:
I figured that the error is caused because I am using MS access 2000 and crystal reports created in 4.x version.
But now I am getting 20525 unable to load report error.I verified the report file name and path.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
20525 indicates the report name is incorrect.

What do strAppPath & strReportName equal?

mlmcc

Author

Commented:
I double checked strAppPath & strReportName .Its right.I guess the problem is due to the reason that MS access 2000 and crystal report 4.x wont get along.Now I did upgraded my reports to 8.x.The error message has changed to Error 20525. Unable to load report" .And I guess this is due to the reason crystal report 8.x with VB doesnt get along with crystal reprt OCX component and I need use Report Designer Component (RDC)....
Am I right??
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
I thought about a conflict between CR4x and Access2K but figured the report worked from CR so that probably wasn't the problem.

You can use the OCX with CR8.x.  Did you update the reference in the VB program to the CR8.5 libraries?

I would start converting to the RDC if it is not too much work since the OCX hasn't been updated since version 6.

Look at for a simple viewer using the RDC

http://www.experts-exchange.com/Databases/Crystal_Reports/Q_20401669.html

I know you have checked strAppPath & strReportName but when combined are they missing a /?

mlmcc

Author

Commented:
I am not able to find the CR8.5 libraries in the refrence list.FYI I am using crystal report component 4.6.
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
The CR 4.6 component cannot read CR8.5 reports.

Which edition of CR8.5 do you have? STandard, Professional, or Developer?  

To use CR8.5 from VB you must have the developer edition.

mlmcc

Author

Commented:
I had the reports stored in my machine but I didnt have Crystal reports installed.Now installed it and the error is gone but I am geting new error saying cannot connect to sql server.I dont have sql server , I am using MS access.
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
I think you need to have a more coplete connection string telling CR what database type to use.

Take a look at

http://support.crystaldecisions.com/communityCS/FilesAndUpdates/FirstClassHotels.zip.asp

This one shows how to connect to an access database
http://support.crystaldecisions.com/communityCS/FilesAndUpdates/SCR8_VB_RDC_DBPassword.exe.asp

mlmcc

Author

Commented:
Let me eloborate the scenario.The application I am dealing with, is said to work well in NT when tried to run in WIN 2000 it started giving all these problems.I installed crystal reports 8.5 then most of the problems are gone except with some reports .action=1 throws cannot open sql server 20599.While I dont use sql server at all .I am using MS access.This errordoesnt show up for all the reports.Some of them work quite perfect while some throws this error.
PLS HELP ME
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
The 20599 error generally indicates the connection string is incomplete?  Have you installed the MS Access 2K drivers?  It should be MS Jet 4.0

mlmcc

Author

Commented:
If thats the case , it shouldnt work with any of the reports , right?.It works with most of the reports except few.
Author of the Year 2009

Commented:
Hi hasan_tek,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

hasan_tek, Please DO NOT accept THIS comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
If you still need help thsi may be what you need

http://support.crystaldecisions.com/library/kbase/articles/c2000510.asp

Though this is for Foxpro, it may give you a hint
http://support.crystaldecisions.com/library/kbase/articles/c2011129.asp

mlmcc
PAQed, with points refunded (75)

Computer101
E-E Admin

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial