Solved

crystal report connection to wrong database

Posted on 2002-04-11
8
432 Views
Last Modified: 2012-01-29
i have a report called 'branch.rpt'. in crystal report, 'branch.rpt' points to an access database at 'c:\reservation1\reservation.mdb.

i have the following codes written in visual basic 6.0 to call the report ('branch.rpt').

Private Sub cmdReport_Click()
   
    With commonDialog
        .DialogTitle = "Cannot open report file"
        .Filter = "(*.RPT) | *.rpt"
    End With
   
    On Error GoTo ErrHandler
   
    With crystalReport
        .DESTINATION = crptToWindow
        .ReportFileName = App.Path & "\Branch.rpt"
        .Connect = connection 'this is of type ADODB.Connection which points to an access database at c:\reservation2\reservation.mdb
        .Action = 1
    End With

ErrHandler:
    Select Case Err
        Case 20507
            UpdateErrorLog
            commonDialog.ShowOpen
            With crystalReport
                .DESTINATION = crptToWindow
                .ReportFileName = commonDialog.fileName
                .Connect = connection 'this is of type ADODB.Connection which points to an access database at c:\reservation2\reservation.mdb
                .Action = 1
            End With
        End Select
 
End Sub

now which i click the 'cmdReport' button, it seemed that 'branch.rpt' is still grabbing the data from 'c:\reservation1\reservation.mdb' instead of 'c:\reservation2\reversation.mdb'.

any ideas?
0
Comment
Question by:lcchu
8 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 6935810
0
 

Author Comment

by:lcchu
ID: 6935822
thanks mlmcc,

the examples showed how to pass in a table. how about multiple tables?
0
 
LVL 2

Expert Comment

by:corvanderlinden
ID: 6936129
Be sure you have not checked the menuitem File|Save data with report
0
 
LVL 1

Expert Comment

by:Madmarlin
ID: 6936135

Have you updated the report file that is sat in the same location as your exe.???

A daft question I know but I once spent 4 hours woiundering why my chages to a report weren't been reflected when I ran it through my app, it turns out that I was editing the report located in my c:\Temp folder and my app was loading the report file from c:\Temp\Temp2 folder..

Also check your connection strings and also with my calls I have a crystall module that uses a collection of login  parameters, which determin the DB, server, UserName & Password. You dont seem to have any such collection.(But I am using an old version of crystal and so maybe its much easier now)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 49

Expert Comment

by:DanRollins
ID: 7653999
Hi lcchu,
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:

    Accept mlmcc's comment(s) as an answer.

lcchu, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 16

Expert Comment

by:twalgrave
ID: 7754980
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
- PAQ/no refund (although mlmcc provided goo info, didn't come back when questioner asked for more clarification)
Please leave any comments here within the
next seven days.
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 7812302
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0
 

Expert Comment

by:eriso79
ID: 8430285
WEY
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

910 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now