?
Solved

Database Source Location  and VB

Posted on 2003-03-04
7
Medium Priority
?
249 Views
Last Modified: 2008-02-07
hi,

CR9 dev & Visual Basic 6

I want to change the database source location of a CR9 report with VB without change the location in the report file...

Thanks
0
Comment
Question by:mystery001
[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
  • 3
  • 2
7 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 8064285
0
 

Author Comment

by:mystery001
ID: 8069965
In fact, it doesn't help me because the document is for CR8 and CR8.5. But, i've got CR9 and it's not the same methods.

Thanks anyway. :-)
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 8071712
What code are you trying to use?

mlmcc
0
 

Author Comment

by:mystery001
ID: 8071786
This is my code
-----------------------------------------------------------
'DECLARATION
Dim UserID As String
Dim Pwd As String
Dim v_seq As String
Dim Source As String
Dim DBsource As String

'Affectation des variables
UserID = "userID"
Pwd = "password"
Base = "baserisc"
v_seq = T_seq.Text
DBsource = "DSN=" & Base & ";;User ID=" & UserID & ";;Password=" & Pwd
   
    'OUVERTURE DU FICHER
    Set CrxRpt = CrxApp.OpenReport("C:\ccm\prc\etats CR\cclt_ess.rpt")

    'CONNEXION BASE DE DONNEE
    CrxRpt.Database.Tables(1).ConnectBufferString = DBsource
   
    'ENVOI DES VALEURS DES PARAMETRES
    CrxRpt.ParameterFields.GetItemByName("v_seq").ClearCurrentValueAndRange
    CrxRpt.ParameterFields.GetItemByName("v_seq").AddCurrentValue v_seq
    CrxRpt.ParameterFields.GetItemByName("indice_langue").ClearCurrentValueAndRange
    CrxRpt.ParameterFields.GetItemByName("indice_langue").AddCurrentValue 20000
    CrxRpt.PaperSize = 155 'us LETTER
   
    F_CRViewer.CRViewer91.ReportSource = CrxRpt 'Définit le fichier à ouvrir dans le contrôle
    F_CRViewer.CRViewer91.ViewReport 'Affiche la rapport
    F_CRViewer.CRViewer91.DisplayGroupTree = False
    F_CRViewer.CRViewer91.Zoom (110)
    F_CRViewer.CRViewer91.DisplayTabs = False
    F_CRViewer.CRViewer91.EnableCloseButton = False
    F_CRViewer.CRViewer91.EnableGroupTree = False
    F_CRViewer.Show

-----------------------------------------------------------

With this method i can connect to my database "baserisc" ("baserisc" being the database set in cclt_ess.rpt).
The problem is that, in my case, i have 4 differents databases (baserisc, baserisd, baserish, baserise) and i want to be able to connect to the differents databases (all the databases have the same structure).
And i don't want to create 4 files with a different database for each file. So, i have to do that in VB !

Thanks to help me. :-)
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 80 total points
ID: 8076218
Take a look at

http://support.crystaldecisions.com/communityCS/TechnicalPapers/cr_dbconn_troubleshooting.pdf.asp


http://support.crystaldecisions.com/communityCS/TechnicalPapers/cr_error_detected_by_db_dll.pdf.asp


This may also be useful

CrystalReport.Application.LogOnServer("pdsodbc.dll","DSNNAME", "DBQ=<crwdc>=databasename", "dbusername","dbpassword")

mlmcc
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

764 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