Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Business Objects: Crystal Reports 4 Other topics FAQ

Report Development

CR 8.5 Logonserver not working for password protected databases by Harshu
Posted: 20 Sep 03

There are so many questions asked about CR not working properly on clients computer having problems like Physical database not found, logonserver errors,file not found and so on.

I have been testing this for past 3 days and found an anwer which i want to share with every one.

i use vb6 and cr 8.5. I create reports using RDC File definitions(ttx files) using Active Data. i have been facing few problems which got solved as given below.

steps :-
1) create a form in vb and put the crystal report viewer control CRV on the form. In the print command button click write the following code.
       'pl note adocn is the connection object oledb connection to the database)

       set rs = new adodb.recordset
       sql = "Select * from itemmst"

       rs.Open sql, adoCN, adOpenStatic, adLockReadOnly

'below opening the rpt file
    Set CrxReport = CrxApplication.OpenReport(App.Path & "\rptItemLST.rpt")

'below for setting the logon information. it works even if
'ur database (access or sql server) is password protected.
'if u r using access database  then the server name can be "Sql server" or even blank it does not matter as if it is blank it will use the server which was used at design time.

'for access u can use
'        CrxReport.Database.Tables(i).SetLogOnInfo "", "database", "usernm", "password"

    For i = 1 To CrxReport.Database.Tables.Count
        CrxReport.Database.Tables(i).SetLogOnInfo "sql server", "database", "usernm", "password"

    with CrxReport
          .Database.SetDataSource rs
    end with

      CRV.ReportSource = CrxReport
       While CRV.IsBusy

2) while making the report ->
start crystal reports -> choose report expert -> standard
-> OK -> Database -> more data sources -> Active data
->Active Data(Field Deifnitions only) click New and the input the fields u want the output from the table.
after that click File -> SAVE -> give the name of the ttx file -> click OK -> ADD ->Close
Now ur ttx file is ready and then u click next and like wise create the report. After that u can design the report using the ttx file fields and then save the report.

once the above two steps are ready the report works ok.
I have tried to explain the steps in a simple way. i hope it helps somebody.

Please note:- While distributing ur project be sure to have these 3 files among other for using the crystal reports with active data (ttx) Craxdrt.dll, crviewer.dll, p2smon.dll

this p2smon.dll is the one used for active data(ttx)
for odbc data sources u have to add p2sodbc.dll and also u
need to install mdac_typ.exe on the client machine


Back to Business Objects: Crystal Reports 4 Other topics FAQ Index
Back to Business Objects: Crystal Reports 4 Other topics Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close