?
Solved

call a crystal reports 4.6 from vb6

Posted on 2009-02-17
3
Medium Priority
?
2,687 Views
Last Modified: 2013-11-28
Hi everybody,
I want to print or preview a report made with crystal reports 4.6 by clicking on command button on a vb6 form.  I want to use version 4.6 of crystal report (don't want to update).  I use an access database (called mydb.mdb).
So I creat a crystal report (called myreport.rpt), a crystal report control ( called CrystalReport1) on the vb6 form and a command button with the associated code:

CrystalReport1.ReportFileName = Dir1.Path & "\myreport.rpt"
CrystalReport1.DataFiles(0) = Dir1.Path & "\mydb.mdb"
CrystalReport1.DiscardSavedData = True
CrystalReport1.action = 0

I get error 20536 : "Unable to connect: incorrect log on parameters"

I tried to use these additional commands:
id = CrystalReport1.LogOnServer("p2sodbc.dll", "access", "mydb", "Admin", "")
or
CrystalReport1.Connect = "dsn=odbc;uid=admin;pwd=;dsq=mydb.mdb"
or
CrystalReport1.LogonInfo(0)= "dsn=access;uid=admin;pwd=;dsq=mydb.mdb"

But none of these solve the problem. And I am not shure that the arguments I wrote are good.

I know this question is already asked on this website, but everytime, the solution is a link like http://support.businessobjects.com/library/kbase/articles/c???????.asp and when I try to follow this link, I am redirected on another website : https://websmp205.sap-ag.de/~SAPIDP/002006825000000234912001E

Thanks in advance for your help.
0
Comment
Question by:gastroju
3 Comments
 
LVL 4

Accepted Solution

by:
spangdelta earned 1500 total points
ID: 23659047
I bought (for $16) Ken Hamady's guide to Crystal reports in VB6.  It showed me exactly what to do to get VB communicating with Crystal.

http://www.kenhamady.com/vbref.html
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 23660995
0
 

Author Comment

by:gastroju
ID: 23668479
Thanks for your answers.
mlmcc, I tried the sample code in splitrpt.zip but i can't execute  the "report1.rpt" file with crystal report (error message: unable to load report). So I ceated another report based on the cost.mdb database with one field (totals.total). And when I launched the vb programm, I got the error 20536 unable to connect : incorrect logon parameters...

spangdelta, does Ken hamady's guide answered your questions about version 4.6 of crystal reports?

Thanks for your help
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Beware when using the ListIndex and the Column() properties of a listbox in Access 2007.  A bug has been identified in the Access 2007 listbox code which can cause the .ListIndex property to return a -1, and the .Columns(#) property to return a NULL…
When we develop an application in Ms Access 2016 we should also try to protect the queries, macros and table links. I know I may not have a permanent solution but for novice users, they will not manage to break your application. Below is the detail …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question