Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

crystal report connection to wrong database

Posted on 2002-04-11
8
Medium Priority
?
464 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 101

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Suggested Courses

618 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