Solved

crystal report connection to wrong database

Posted on 2002-04-11
8
440 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

840 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