Solved

crystal report connection to wrong database

Posted on 2002-04-11
8
431 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
Comment Utility
0
 

Author Comment

by:lcchu
Comment Utility
thanks mlmcc,

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

Expert Comment

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

Expert Comment

by:Madmarlin
Comment Utility

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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
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
Comment Utility
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
Comment Utility
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0
 

Expert Comment

by:eriso79
Comment Utility
WEY
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

771 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

10 Experts available now in Live!

Get 1:1 Help Now