Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Database Source Location  and VB

Posted on 2003-03-04
7
Medium Priority
?
252 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
  • 3
  • 2
5 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

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

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 …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

581 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