Link to home
Start Free TrialLog in
Avatar of hasan_tek
hasan_tek

asked on

Crystal report - VB error

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.
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

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
Avatar of hasan_tek
hasan_tek

ASKER

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
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.
20525 indicates the report name is incorrect.

What do strAppPath & strReportName equal?

mlmcc
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??
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

https://www.experts-exchange.com/questions/20401669/Report-viewers-for-crystal-reports-8-5.html

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

mlmcc
I am not able to find the CR8.5 libraries in the refrence list.FYI I am using crystal report component 4.6.
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
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.
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
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
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
If thats the case , it shouldnt work with any of the reports , right?.It works with most of the reports except few.
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
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
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

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