Solved

crystal report connection to wrong database

Posted on 2002-04-11
8
438 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB6 Compile Compatibility Issue 4 102
Exit a vb6 apps when a calling it apps closes 15 48
VB6 ListBox Question 4 42
Error with a code discussed on this page 5 13
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

776 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